Files
Nim/tests/generics/t7446.nim
Bung 083ea8f10c fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural' (#20522)
* fix #7446 Generics: type mismatch 'SomeunsignedInt or Natural'

* try fix
2022-10-11 11:42:49 +02:00

10 lines
169 B
Nim

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