We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please answer these questions before submitting your issue. Thanks!
The main.k, compile it by kcl run main.k
main.k
kcl run main.k
schema Cluster: name: str extra: int a: Cluster = { name = "abc", extra = 6 } enrich = lambda value { [a] } result_typesafe: [Cluster] = enrich({name = "abc", extra = 6 })
The result
a: name: abc extra: 6 result_typesafe: - name: abc extra: 6
The type error
error[E2G22]: TypeError --> /main.k:16:38 | 16 | result_typesafe: [Cluster] = enrich({name = "abc", extra = 6 }) | ^ expected Cluster, got str(abc) | --> /main.k:16:1 | 16 | result_typesafe: [Cluster] = enrich({name = "abc", extra = 6 }) | ^ variable is defined here, its type is Cluster, but got str(abc) | error[E2G22]: TypeError --> /main.k:16:52 | 16 | result_typesafe: [Cluster] = enrich({name = "abc", extra = 6 }) | ^ expected Cluster, got int(6) | --> /main.k:16:1 | 16 | result_typesafe: [Cluster] = enrich({name = "abc", extra = 6 }) | ^ variable is defined here, its type is Cluster, but got int(6) |
kcl v0.10.0
The text was updated successfully, but these errors were encountered:
Peefy
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The
main.k
, compile it bykcl run main.k
2. What did you expect to see? (Required)
The result
3. What did you see instead (Required)
The type error
4. What is your KCL components version? (Required)
kcl v0.10.0
The text was updated successfully, but these errors were encountered: