Fix GDScriptAnalyzer::is_shadowing() missing warnings for shadowed global constants#106984
Fix GDScriptAnalyzer::is_shadowing() missing warnings for shadowed global constants#106984EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
GDScriptAnalyzer::is_shadowing() missing warnings for shadowed global constants#106984Conversation
a8e9f9a to
50855c4
Compare
|
Converted to Draft PR, still discovering additional bugs to be fixed:
Edit: Fixed. |
4736d02 to
d007513
Compare
|
Fixed all of the bugs listed above. Will add more test cases next.
The only notable side effect of the new enum warnings, unsure if it needs to be implemented in this PR. Edit: This will be fixed in a future PR. |
61c3192 to
73cc4ff
Compare
|
Added more test cases and completed manual testing. Ready for review. |
73cc4ff to
a9f7543
Compare
|
The unit tests all passed, but some leaked memory. Edit: Fixed. |
1f2f570 to
c330179
Compare
|
I will refactor this PR soon, so this will be made a draft until then. Edit: This PR now focuses on adding warnings for shadowed global constants. Less relevant code has been moved to other PRs: |
389a82b to
d087b54
Compare
d78cb1f to
8725c56
Compare
GDScriptAnalyzer::is_shadowing() missing warning for shadowed global constants
GDScriptAnalyzer::is_shadowing() missing warning for shadowed global constantsGDScriptAnalyzer::is_shadowing() missing warning for shadowed @GDScript constants
GDScriptAnalyzer::is_shadowing() missing warning for shadowed @GDScript constantsGDScriptAnalyzer::is_shadowing() missing warnings for shadowed @GDScript constants
4386780 to
bf336db
Compare
|
Below is a full summary of what this PR fixed, and what will be fixed in future issues/proposals: class_name _Main
extends Node
var PI = -10 # Missing warning. <-- Fixed! Now warns (SHADOWED_GLOBAL_IDENTIFIER)
var OK = -20 # Missing warning. <-- Fixed! Now warns (SHADOWED_GLOBAL_IDENTIFIER)
enum Error { # Missing warning. --> Proposal #14425
OK = -30 # Missing warning. --> Proposal #14425
}
var Side = -40 # Missing warning. <-- Fixed! Now warns (SHADOWED_GLOBAL_IDENTIFIER)
var MouseButtonMask # Missing warning. <-- Fixed! Now warns (SHADOWED_GLOBAL_IDENTIFIER)
var number = -60 # No warning. |
50d9ab1 to
48559de
Compare
48559de to
1eb0374
Compare
|
Accidentally closed the PR... |
…global constants.
eef7141 to
06601b4
Compare
GDScriptAnalyzer::is_shadowing() missing warnings for shadowed @GDScript constantsGDScriptAnalyzer::is_shadowing() missing warnings for shadowed global constants
Closes: #117567
Related: #106987
Note: Some previous code has been split into #117545 to keep this PR manageable.
Any help is appreciated!