Closed bozaro closed 3 months ago
Run configuration with KCL_FAST_EVAL=1 (KCL_FAST_EVAL=1 kclvm_cli run .)
KCL_FAST_EVAL=1
KCL_FAST_EVAL=1 kclvm_cli run .
schema User: id: str schema Users: [str]: User schema DB: users: Users = {} check: all user in users { user == users[user].id } schema DBs: [str]: DB dbs_user: DBs = { user = DB { users = { app = User {id = "app"} } } } db_user = dbs_user.user
Same result as without KCL_FAST_EVAL=1:
dbs_user: user: users: app: id: app db_user: users: app: id: app
error[E3M38]: EvaluationError --> /home/bozaro/joom/config-state/kcl/data/mongodb/joomproduction/user.k:25:1 | 25 | db_user = dbs_user.user | schema 'DBs' attribute 'user' not found |
➜ kclvm_cli version Version: 0.9.0-c020ab3eb4b9179219d6837a57f5d323 Platform: x86_64-unknown-linux-gnu GitCommit: 11dffcb46314f5cf326b7aec6c30c1889f3d29ac
There are internally some user variable name collision between lines:
user
all user in users {
user = DB {
Thanks for the feedback and fixed in https://github.com/kcl-lang/kcl/pull/1456
Bug Report
1. Minimal reproduce step (Required)
Run configuration with
KCL_FAST_EVAL=1
(KCL_FAST_EVAL=1 kclvm_cli run .
)2. What did you expect to see? (Required)
Same result as without
KCL_FAST_EVAL=1
:3. What did you see instead (Required)
4. What is your KCL components version? (Required)