Closed zong-zhe closed 7 months ago
Please answer these questions before submitting your issue. Thanks!
The test.json
{ "name": 10, "age": 18, "message": "This is Alice" }
The main.k
schema User: name: str age: int message?: str
The command
kcl vet test.json main.k
error[E2G22]: TypeError --> test.json:2:5 | 2 | "name": 10, | ^ expected str, got int(10) | --> main.k:2:5 | 2 | name: str | ^ variable is defined here, its type is str, but got int(10) |
error[E2G22]: TypeError --> /var/folders/yt/9fs5v0ls7_q4kn7dq3k6nz3h0000gp/T/.tmpbX6kWB:2:5. # The invalid file path | 2 | "name": 10, | ^ expected str, got int(10) | --> main.k:2:5 | 2 | name: str | ^ variable is defined here, its type is str, but got int(10) |
The main branch
Closed by https://github.com/kcl-lang/kcl/pull/1103
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The test.json
The main.k
The command
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your KCL components version? (Required)
The main branch