Sorrry if this is due to a mistake of mine, or if it's a known issue. But quoting literal numbers makes little sense type-wise to me, and I easily found a work around on SO which typescript is happy with.
Bug:
import {N} from 'ts-toolbelt';
type T = N.Range<1, 100>;
Error/warning
[{
"resource":...,
"owner": "typescript",
"code": "2589",
"severity": 8,
"message": "Type instantiation is excessively deep and possibly infinite.",
"source": "ts",
"startLineNumber": ...,
"startColumn": ...,
"endLineNumber": ....,
"endColumn": ...
}]
Alternative implementation from Guillaume Mastio:
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N
? Acc[number]
: Enumerate<N, [...Acc, Acc['length']]>
type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>
type T = Range<20, 100>