-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugSomething isn't workingSomething isn't workingcompiler/semRelated to semantic-analysis system of the compilerRelated to semantic-analysis system of the compilergood first issueEasy-to-start-with issue requiring no in-depth knowledge or complex implementation.Easy-to-start-with issue requiring no in-depth knowledge or complex implementation.
Description
The error reported for when a variable is being accessed at compile-time in a fields iterator, uses the line info of the loop rather than the erroneous statement.
Example
type
Test = object
a: int
var test = Test(a: 1)
for v in test.fields:
when v == 2: discard
Actual Output
/home/chronos/test/main.nim(7, 10) Error: cannot evaluate at compile time: test
Expected Output
/home/chronos/test/main.nim(8, 7) Error: cannot evaluate at compile time: test
Possible Solution
Additional Information
Seems to be an issue of the lineinfo not being set correctly, since the information is attached to the for loop rather than the statement.
References
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompiler/semRelated to semantic-analysis system of the compilerRelated to semantic-analysis system of the compilergood first issueEasy-to-start-with issue requiring no in-depth knowledge or complex implementation.Easy-to-start-with issue requiring no in-depth knowledge or complex implementation.