diff options
author | metagn <metagngn@gmail.com> | 2024-09-17 04:50:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 09:50:10 +0800 |
commit | fe55dcb2be26e9b955ad949a65bf94e65478a1ab (patch) | |
tree | 37827bb2eb0a56ede886a66b95130e3fda1bb265 /tests/lookups | |
parent | 651fdbe586bcee64bd7f4b96c2b98b5970d0eb62 (diff) | |
download | Nim-fe55dcb2be26e9b955ad949a65bf94e65478a1ab.tar.gz |
test case haul before 2.2 (#24119)
closes #4774, closes #7385, closes #10019, closes #12405, closes #12732, closes #13270, closes #13799, closes #15247, closes #16128, closes #16175, closes #16774, closes #17527, closes #20880, closes #21346
Diffstat (limited to 'tests/lookups')
-rw-r--r-- | tests/lookups/mdisambsym1.nim | 2 | ||||
-rw-r--r-- | tests/lookups/mdisambsym2.nim | 1 | ||||
-rw-r--r-- | tests/lookups/mdisambsym3.nim | 1 | ||||
-rw-r--r-- | tests/lookups/mmacroamb.nim | 10 | ||||
-rw-r--r-- | tests/lookups/tdisambsym.nim | 8 | ||||
-rw-r--r-- | tests/lookups/tmacroamb.nim | 5 |
6 files changed, 27 insertions, 0 deletions
diff --git a/tests/lookups/mdisambsym1.nim b/tests/lookups/mdisambsym1.nim new file mode 100644 index 000000000..b8beca035 --- /dev/null +++ b/tests/lookups/mdisambsym1.nim @@ -0,0 +1,2 @@ +proc count*(s: string): int = + s.len diff --git a/tests/lookups/mdisambsym2.nim b/tests/lookups/mdisambsym2.nim new file mode 100644 index 000000000..1e056311d --- /dev/null +++ b/tests/lookups/mdisambsym2.nim @@ -0,0 +1 @@ +var count*: int = 10 diff --git a/tests/lookups/mdisambsym3.nim b/tests/lookups/mdisambsym3.nim new file mode 100644 index 000000000..95bd19702 --- /dev/null +++ b/tests/lookups/mdisambsym3.nim @@ -0,0 +1 @@ +const count* = 3.142 diff --git a/tests/lookups/mmacroamb.nim b/tests/lookups/mmacroamb.nim new file mode 100644 index 000000000..107e51055 --- /dev/null +++ b/tests/lookups/mmacroamb.nim @@ -0,0 +1,10 @@ +# issue #12732 + +import std/macros +const getPrivate3_tmp* = 0 +const foobar1* = 0 # comment this or make private and it'll compile fine +macro foobar4*(): untyped = + newLit "abc" +template currentPkgDir2*: string = foobar4() +macro currentPkgDir2*(dir: string): untyped = + newLit "abc2" diff --git a/tests/lookups/tdisambsym.nim b/tests/lookups/tdisambsym.nim new file mode 100644 index 000000000..678528ad6 --- /dev/null +++ b/tests/lookups/tdisambsym.nim @@ -0,0 +1,8 @@ +# issue #15247 + +import mdisambsym1, mdisambsym2, mdisambsym3 + +proc twice(n: int): int = + n*2 + +doAssert twice(count) == 20 diff --git a/tests/lookups/tmacroamb.nim b/tests/lookups/tmacroamb.nim new file mode 100644 index 000000000..854017e72 --- /dev/null +++ b/tests/lookups/tmacroamb.nim @@ -0,0 +1,5 @@ +# issue #12732 + +import mmacroamb +const s0 = currentPkgDir2 #[tt.Error + ^ ambiguous identifier: 'currentPkgDir2' -- use one of the following:]# |