summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_analyzer.cpp
AgeCommit message (Collapse)Author
2022-03-07Restore building web platform by enclosing resolve_function_signature.K. S. Ernest (iFire) Lee
2022-03-06GDScript: Check if method signature matches the parentGeorge Marques
To guarantee polymorphism, a method signature must be compatible with the parent. This checks if: 1. Return type is the same. 2. The subclass method takes at least the same amount of parameters. 3. The matching parameters have the same type. 4. If the subclass takes more parameters, all of the extra ones have a default value. 5. If the superclass has default values, so must have the subclass. There's a few test cases to ensure this holds up.
2022-03-04Merge pull request #58185 from V-Sekai/explicit_variant_assignment_fixRémi Verschelde
2022-03-04Merge pull request #58626 from groud/fix_gdscript_analyser_crashRémi Verschelde
2022-03-03Merge pull request #58262 from Sauermann/fix-range-docMax Hilbrunner
Describe usage of float in range documentation
2022-02-28Fix a crash in GDScriptAnalyzer when a script class's file is not foundGilles Roudière
2022-02-22Fixes cyclic detection from variables assigning themselves to themselves in ↵SaracenOne
autocomplete, and restricts initialization of variables from other variables which have not been declared above it in class body
2022-02-18Describe usage of float in range documentationMarkus Sauermann
2022-02-16Fix error when assigning to an explicitly annotated variant from an ↵SaracenOne
ambiguous source
2022-02-08Refactor some object type checking code with `cast_to`Rémi Verschelde
Less stringly typed logic, and less String allocations and comparisons.
2022-02-04Merge pull request #57591 from vnen/gdscript-enum-fixesRémi Verschelde
2022-02-03GDScript: Treat enum values as int and enum types as dictionaryGeorge Marques
Since enums resolve to a dictionary at runtime, calling dictionary methods on an enum type is a valid use case. This ensures this is true by adding test cases. This also makes enum values be treated as ints when used in operations.
2022-02-03GDScript: Consolidate behavior for assigning enum typesGeorge Marques
This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
2022-01-26Fix crash with non-constant keys in match statement Dictionary patterncdemirer
2022-01-17Merge pull request #55995 from Xwdit/enum_fixRémi Verschelde
Fix enum int comparison
2022-01-10Merge pull request #56194 from cdemirer/fix-operation-result-type-inferenceRémi Verschelde
2022-01-10Merge pull request #56232 from V-Sekai/invalid_explicit_variant_assign_fixRémi Verschelde
2022-01-10Merge pull request #56260 from ↵Rémi Verschelde
cdemirer/fix-type-mutation-upon-assignment-with-operation
2022-01-05Merge pull request #56483 from vnen/gdscript-warning-annotationRémi Verschelde
Add annotation to ignore warnings
2022-01-04GDScript: Add annotation to ignore warningsGeorge Marques
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-27Fix type mutation upon compound assignmentcdemirer
2021-12-25Fix 'Compiler bug: unresolved assign' on explicitly annotated variants.SaracenOne
2021-12-23Fix operation result type inferencecdemirer
2021-12-16Fix enum int comparisonXwdit
Fix enum int comparison
2021-12-14Avoid a crash in the gdscript analyserGilles Roudière
2021-12-13Fix shadowed global identifier warning duplicationYuri Roubinsky
2021-11-23Improve various textskobewi
2021-10-18Fix incorrect debug check for settersBenjamin Navarro
the check read the return type of the setter, which doesn't exist and lead to a segmentation fault. Now we check the first function parameter. Probably a bad copy/paste of the getter case
2021-10-15Merge pull request #53843 from vnen/gdscript-typed-array-subscript-constantRémi Verschelde
Fix inferred typed array marked as constant
2021-10-15GDScript: Fix inferred typed array marked as constantGeorge Marques
2021-10-14GDScript: Fix typing for await expressionGeorge Marques
Don't grab the type of the awaited value unless it's constant (which makes it synchronous) or call (which always use the proper return type).
2021-10-14GDScript: Remove error when coroutine is called without awaitGeorge Marques
In the case the call happens as a statement, since the return value isn't used in this case.
2021-10-14Merge pull request #53726 from briansemrau/gd-outer-classGeorge Marques
GDScript 2.0: Access outer scope classes
2021-10-13GDScript: Access outer scope classesBrian Semrau
2021-10-12Merge pull request #53720 from vnen/gdscript-typed-array-custom-classRémi Verschelde
2021-10-12GDScript: Fix typed array with custom classesGeorge Marques
2021-10-12GDScript: Make setter parameter type same as variable typeGeorge Marques
2021-10-08GDScript: Report property type errorsZuBsPaCe
Inline getters & setters are now FunctionNodes. Their names are set in the parser, not in the compiler. GDScript-Analyzer will now run through getter and setter. Also report wrong type or signature errors regarding getset properties. Added GDScript tests for getters and setters. #53102
2021-10-07GDScript: Use getter return type for the property typeGeorge Marques
The PropertyInfo hints are more relevant for the inspector. The getter return type is more reliable and less likely to be incorrect and it is what's going to be called in the end.
2021-10-06Merge pull request #53479 from vnen/gdscript-subscript-object-selfRémi Verschelde
2021-10-06GDScript: Allow subscript on self and object typesGeorge Marques
2021-10-06GDScript: Avoid hard errors on inferred typesGeorge Marques
Since inference isn't always correct, they are now treated as unsafe instead of errors. This also removes inferred type when a variable is reassigned. Since it's not aware of branching, the types might become invalid in a later context.
2021-10-04GDScript: Use path cache when checking preloaded scriptsGeorge Marques
The path itself might not always be set in some cases, especially when the script is just created and is already in the resource cache. Using get_path() in this case gets the correct resource path. This also adds a null check for safety in case the path is incorrect or missing, to avoid a crash in the engine.
2021-10-04Merge pull request #53338 from briansemrau/gdscript-handle-for-with-null-listRémi Verschelde
2021-10-03Allow void as return type for constructorskobewi
2021-10-02GDScript Check for null list in `for` loopBrian Semrau
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-30Revert "GdScript: Use reduced constant expression result when doing binary ↵Rémi Verschelde
operations. Fixes #50293" This reverts commit 62077086076fb99fb7fe014522c44ae83f87dc4d. It broke a GDScript test (which didn't exist back when the PR was made, so was missed prior to the merge). It choked on: ``` prints("a", test_instance.a, test_instance.a == Named.VALUE_A) ``` With: ``` Invalid operands "VALUE_A (enum value)" and "int" for "==" operator. ```
2021-09-30Merge pull request #51818 from MarianoGnu/gdscript2-enum-fixesRémi Verschelde