Closed dennybaa closed 3 months ago
Do you mean this
schema FooBar:
mixin [
FooBarMixin
]
foo: str = 'foo'
bar: str = 'bar'
protocol FooBarProtocol:
foo: str
bar: str
mixin FooBarMixin for FooBarProtocol:
foobar: str = "${foo}.${bar}" # Attribute with the annotation can be accessed outside the schema.
_c = FooBar {}
foobar = _c.foobar
Yep _c.foobar
, this one, just the example above, produces the following error:
Error: failed to compile the kcl package
error[E2G22]: TypeError
--> ...a.k:17:10
|
17 | foobar = _c.foobar
| ^ attribute 'foobar' not found in 'FooBar', did you mean '["foo"]'? ```
Ah sorry, it might be I need to add specifically into the schema...( Sorry! This is a bit confusing, but it's okay.
@Peefy , made the PR #381
Hello @Peefy! Hope I'm not overproducing entropy) The following looks like a bug, I haven't seen it mentioned anywhere.
Steps to reproduce:
Expected output:
Obviously casting to any mitigates the issue
_c = {**FooBar{}}
. Thanks a lot :+1: !