-
- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
In the below code, the type of x is set to Foo even though it was declared int and Foo is not in scope.
This causes a compiler crash later when x is used since Foo is a generic and wasn't instantiated.
Example
block: type Foo[n: static int] = int block: static: let x = int 1 echo x.type # Foo block: static: let x = int 1 let y = x + 1 # Error: unhandled exception: value out of range: -8 notin 0 .. 65535 [RangeDefect] echo yCurrent Output
Foo fatal.nim(53) sysFatal Error: unhandled exception: value out of range: -8 notin 0 .. 65535 [RangeDefect] Expected Output
int 2 Possible Solution
Additional Information
This happens on devel, 1.6 and 1.4.
This is related to #15356.