Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

add hack to prevent True/False/None/... from being use-before-def #464

Merged
merged 1 commit into from
Dec 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Analysis/Engine/Impl/Analyzer/ExpressionEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,19 @@ public IAnalysisSet LookupAnalysisSetByName(Node node, string name, bool addRef
refs = createIn.CreateVariable(node, _unit, name, addRef);
res = refs.Types;
} else {
// ... warn the user
warn = true;
switch (name) {
// "atom" in Python grammar.
case "True":
case "False":
case "None":
case "...":
Debug.Fail($"Known good name '{name}' not found in scope");
break;
default:
// ... warn the user
warn = true;
break;
}
}
}
}
Expand Down