nim-lang / Nim

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).
https://nim-lang.org
Other
16.57k stars 1.47k forks source link

type constraint circumvention with int literals #1214

Open ghost opened 10 years ago

ghost commented 10 years ago

This shouldn't compile

import typetraits

proc p(x: int8|int16) =
  echo x.type.name # int

p(1)
metagn commented 1 month ago

This shouldn't compile

Arguable but this is still the same bug as #4858 etc, fixing it would make the result here int8 which could count as an issue, which this could serve to track