diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-03-05 23:55:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-06 08:55:53 +0100 |
commit | b80d293a3f8c301a2d9188fb409162028a00edca (patch) | |
tree | 5e79b0c60834e9e655950f0a064e2f2c028d6c7b /tests | |
parent | cb0f7c5d9e1534cf3d43be9eade316bfc7fe25ad (diff) | |
download | Nim-b80d293a3f8c301a2d9188fb409162028a00edca.tar.gz |
close #12704 by adding a test (tuple codegen error) (#13592)
* close #12704 by adding a test * move test to tests/metatype/ttypedesc2.nim
Diffstat (limited to 'tests')
-rw-r--r-- | tests/metatype/ttypedesc2.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/metatype/ttypedesc2.nim b/tests/metatype/ttypedesc2.nim index 89c38f367..96dab9052 100644 --- a/tests/metatype/ttypedesc2.nim +++ b/tests/metatype/ttypedesc2.nim @@ -35,9 +35,23 @@ type Point[T] = tuple[x, y: T] proc origin(T: typedesc): Point[T] = discard discard origin(int) +block: # issue #12704 + const a = $("a", "b") + proc fun() = + const str = $int + let b = $(str, "asdf") + fun() + # https://github.com/nim-lang/Nim/issues/7516 import typetraits +block: #issue #12704 + const a = $("a", "b") + proc fun() = + const str = name(int) + let b = $(str, "asdf") + fun() + proc hasDefault1(T: type = int): auto = return T.name doAssert hasDefault1(int) == "int" doAssert hasDefault1(string) == "string" |