Closed steeling closed 6 months ago
Following this example https://github.com/kcl-lang/examples/tree/main/abstraction
The following setup doesn't work:
file1.k:
schema MySchema: field1: any obj = MySchema { field1 = obj2 } obj2 = { x = 10 }
file2.k:
import manifests manifests.yaml_stream([o.field1 for o in MySchema.instances()])
kcl file1.k file2.k renders error:
kcl file1.k file2.k
| 6 | obj = MySchema { | attribute 'field1' of MySchema is required and can't be None or Undefined
However this works: file3:
schema MySchema: field1: any obj2 = { x = 10 } obj = MySchema { field1 = obj2 }
Only difference above is placement of obj2.
obj2
Thank you for your feedback ❤️. We are working hard to support it. It has been basically completed and is currently being tested.
The related PRs and Issues:
PR:
Issues:
Following this example https://github.com/kcl-lang/examples/tree/main/abstraction
The following setup doesn't work:
file1.k:
file2.k:
kcl file1.k file2.k
renders error:However this works: file3:
Only difference above is placement of
obj2
.