diff options
author | metagn <metagngn@gmail.com> | 2023-06-13 13:04:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 12:04:24 +0200 |
commit | fda8b6f193e2e229488f76f18089f01eb08272fb (patch) | |
tree | ae3430a6bcfaa71060a89143b04c4cc381be15b1 /tests/lookups/tambiguousemit.nim | |
parent | 2e12d3e26bd39205a2aa61a8873173e579cbcb9e (diff) | |
download | Nim-fda8b6f193e2e229488f76f18089f01eb08272fb.tar.gz |
strictly typecheck expressions in bracketed `emit` (#22074)
* strictly typecheck expressions in bracketed `emit` * use nim check in test
Diffstat (limited to 'tests/lookups/tambiguousemit.nim')
-rw-r--r-- | tests/lookups/tambiguousemit.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lookups/tambiguousemit.nim b/tests/lookups/tambiguousemit.nim new file mode 100644 index 000000000..0ebd0a255 --- /dev/null +++ b/tests/lookups/tambiguousemit.nim @@ -0,0 +1,12 @@ +discard """ + cmd: "nim check $options $file" # use check to assure error is pre-codegen + matrix: "; --backend:js" # backend shouldn't matter but at least check js +""" + +proc foo(x: int) = discard +proc foo(x: float) = discard + +{.emit: ["// ", foo].} #[tt.Error + ^ ambiguous identifier 'foo' -- use one of the following: + tambiguousemit.foo: proc (x: int){.noSideEffect, gcsafe.} + tambiguousemit.foo: proc (x: float){.noSideEffect, gcsafe.}]# |