From 266cc69f1973773228534f074febd153c472b949 Mon Sep 17 00:00:00 2001 From: Bung Date: Wed, 24 May 2023 21:30:14 +0800 Subject: fix #21896 asign parameter to global variable generates invalid code (#21900) --- tests/global/t21896.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/global/t21896.nim (limited to 'tests/global') 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) -- cgit 1.4.1-2-gfad0