Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
In the Generics type mismatch series #7432 and #7446
type HexChars = range['0'..'9'] or range['A'..'F'] or range['a'..'f']
proc foo(x: HexChars) = discard
let a = '0'
foo(a)
Error: type mismatch: got <char>
but expected one of:
proc foo(x: HexChars)
expression: foo(a)
I'm not sure range can be used like that but there should be an error message "you cannot combine Generics with ranges" in case it's not supposed to work like that.
In the Generics type mismatch series #7432 and #7446
I'm not sure range can be used like that but there should be an error message "you cannot combine Generics with ranges" in case it's not supposed to work like that.