This fails to compile: type Range[T] = object start, limit: T proc fromTo[T: SomeOrdinal](a, b: T;): Range[T] = result.start = a result.limit = b echo fromTo("a", "b")
But this compiles: type Range[T: SomeOrdinal] = object start, limit: T proc fromTo[T](a, b: T;): Range[T] = result.start = a result.limit = b echo fromTo("a", "b") And this crashes the compiler: type Range[T: SomeOrdinal] = object start, limit: T proc fromTo[T: SomeOrdinal](a, b: T;): Range[T] = result.start = a result.limit = b echo fromTo("a", "b") I'm using Nim version 0.17.0 on Windows. To me, only the first one makes sense. Am I missing something?