diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-10-01 14:15:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 14:15:35 +0200 |
commit | e867c8e5c3cf5c08c703e76434fc7db962f755f7 (patch) | |
tree | 077eea3f3e0986363d8296b1b74cefcceb7310e5 /tests/generics/t8694.nim | |
parent | aa8249d177cbac4a3c08348ea6dbe12d6526928d (diff) | |
parent | 5298c509a7b0168f0edce9b28442feca914d15f7 (diff) | |
download | Nim-e867c8e5c3cf5c08c703e76434fc7db962f755f7.tar.gz |
Merge branch 'devel' into fix_issues_9126
Diffstat (limited to 'tests/generics/t8694.nim')
-rw-r--r-- | tests/generics/t8694.nim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/generics/t8694.nim b/tests/generics/t8694.nim new file mode 100644 index 000000000..da6c6dbed --- /dev/null +++ b/tests/generics/t8694.nim @@ -0,0 +1,31 @@ +discard """ + output: ''' +true +true +true +''' +""" + +when true: + # Error: undeclared identifier: '|' + proc bar[T](t:T): bool = + runnableExamples: + type Foo = int | float + true + echo bar(0) + +when true: + # ok + proc bar(t:int): bool = + runnableExamples: + type Foo = int | float + true + echo bar(0) + +when true: + # Error: undeclared identifier: '|' + proc bar(t:typedesc): bool = + runnableExamples: + type Foo = int | float + true + echo bar(int) |