-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
It looks like the types captured for TestMap in here, cannot capture Properties
.

package main
import (
"bytes"
"fmt"
"os"
"kcl-lang.io/kcl-go/pkg/tools/gen"
)
const code = `
schema Main:
maps: TestMap
schema Test:
name: str
surname: str
schema TestMap:
[name: str]: Test = {name = name}
`
func main() {
var buf bytes.Buffer
err := gen.GenGo(&buf, fmt.Sprintf("test.k"), code, nil)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
fmt.Println(buf.String())
}
2. What did you expect to see? (Required)
type TestMap map[string]Test
type Test struct {
name string `kcl:"name=name,type=str"` // kcl-type: str
surname string `kcl:"name=surname,type=str"` // kcl-type: str
}
type Main struct {
maps *TestMap `kcl:"name=maps,type=TestMap"` // kcl-type: TestMap
}
3. What did you see instead (Required)
type TestMap struct {
}
type Test struct {
name string `kcl:"name=name,type=str"` // kcl-type: str
surname string `kcl:"name=surname,type=str"` // kcl-type: str
}
type Main struct {
maps *TestMap `kcl:"name=maps,type=TestMap"` // kcl-type: TestMap
}
4. What is your KCL components version? (Required)
0.10.10-darwin-arm64
Metadata
Metadata
Assignees
Labels
No labels