json: fix decode codegen for []&type (fix #23007) (#23010)

This commit is contained in:
Felipe Pena 2024-11-30 03:40:14 -03:00 committed by GitHub
parent f2c281eadf
commit a66c4c9340
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,10 @@
import json
struct Test {
a string
}
fn test_main() {
x := json.decode([]&Test, '[{"a":"a"}]') or { exit(1) }
assert x[0].a == 'a'
}