fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural' (#20522)

* fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural'

* try fix
This commit is contained in:
Bung 2022-10-11 17:42:49 +08:00 • committed by GitHub
commit 083ea8f10c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

10
tests/generics/t7446.nim Normal file
View file

@ -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