diff options
author | Bung <crc32@qq.com> | 2023-05-24 21:30:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 15:30:14 +0200 |
commit | 266cc69f1973773228534f074febd153c472b949 (patch) | |
tree | becee58cd91e73427266eaf76285a2e1cdf3207b /tests/global | |
parent | 761b927e4700ecda2dde8b16fb8beab791436e99 (diff) | |
download | Nim-266cc69f1973773228534f074febd153c472b949.tar.gz |
fix #21896 asign parameter to global variable generates invalid code (#21900)
Diffstat (limited to 'tests/global')
-rw-r--r-- | tests/global/t21896.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/global/t21896.nim b/tests/global/t21896.nim new file mode 100644 index 000000000..c7765c4dd --- /dev/null +++ b/tests/global/t21896.nim @@ -0,0 +1,9 @@ +discard """ + errormsg: "cannot assign local to global variable" + line: 7 +""" + +proc example(a:int) = + let b {.global.} = a + +example(1) |