You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V full version: V 0.3.4 1be798b.4e21b2a
OS: macos, macOS, 13.3.1, 22E772610a
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Describe the bug
Compiling this code:
fails with the following error:
bug_map.v:6:10: error: invalid map value: expected `T`, not `int literal` 4 | // m := { 'a': 1 } 5 | // f(m) 6 | f({ 'a': 1 }) | ^
Expected Behavior
The compilation should succeed resolving the function to:
Current Behavior
The compilation fails with the message above.
Reproduction Steps
bug_map.v
.v bug_map.v
on the command line.Or try it at https://vosca.dev/p/27605a3527.
Possible Solution
I wish I knew :-)
Additional Information/Context
It appears to be connected to maybe just parsing the value and not storing temporarily its type. If the value argument in the function call:
is replaced with a variable, which has probably its type generated, the compilation succeeds:
See at https://vosca.dev/p/2d10eaa9f8.
V version
V 0.3.4 4e21b2a
Environment details (OS name and version, etc.)
V full version: V 0.3.4 1be798b.4e21b2a
OS: macos, macOS, 13.3.1, 22E772610a
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
getwd: /Users/prantlf/Sources/github/v-yaml
vexe: /usr/local/Cellar/vlang/0.3.4/libexec/v
vexe mtime: 2023-06-03 11:39:19
vroot: OK, value: /usr/local/Cellar/vlang/0.3.4/libexec
VMODULES: OK, value: /Users/prantlf/.vmodules
VTMP: OK, value: /tmp/v_501
Git version: git version 2.41.0
Git vroot status: weekly.2023.22-6-g4e21b2ab
.git/config present: true
CC version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
thirdparty/tcc status: thirdparty-macos-amd64 46662e2
The text was updated successfully, but these errors were encountered: