diff options
author | Bung <crc32@qq.com> | 2022-10-11 17:42:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 11:42:49 +0200 |
commit | 083ea8f10cb27834cc9c22ba496de7a378f3c301 (patch) | |
tree | 4913455e2df4901524783bfa903d1722524ca5d7 /tests/generics | |
parent | 5602183234f59ece4fd668915da848f0753cbbb9 (diff) | |
download | Nim-083ea8f10cb27834cc9c22ba496de7a378f3c301.tar.gz |
fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural' (#20522)
* fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural' * try fix
Diffstat (limited to 'tests/generics')
-rw-r--r-- | tests/generics/t7446.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/generics/t7446.nim b/tests/generics/t7446.nim new file mode 100644 index 000000000..71aa8f0e8 --- /dev/null +++ b/tests/generics/t7446.nim @@ -0,0 +1,10 @@ +proc foo(x: Natural or SomeUnsignedInt):int = + when x is int: + result = 1 + else: + result = 2 +let a = 10 +doAssert foo(a) == 1 + +let b = 10'u8 +doAssert foo(b) == 2 \ No newline at end of file |