summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/errors
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #72608 from vnen/gdscript-warning-default-errorYuri Sizov2023-02-051-1/+1
|\ \ | | | | | | GDScript: Add warnings that are set to error by default (take 2)
| * | GDScript: Add warnings that are set to error by defaultGeorge Marques2023-02-021-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adds a list of default levels for all warning so they can be set individually. - Add warnings set by default to error for: - Using `get_node()` without `@onready`. - Using `@onready` together with `@export`. - Inferring a static type with a Variant value. - Overriding a native engine method. - Adjust how annotations to ignore warnings are treated so they also apply to method parameters. - Clean up a bit how ignored warnings are set. There were two sets but only one was actually being used. - Set all warnings to the `WARN` level for tests, so they they can be properly tested. - Fix enum types in native methods signatures being set to `int`. - Fix native enums being treated as Dictionary by mistake. - Make name of native enum types use the class they are defined in, not the direct super class of the script. This ensures they are always equal even when coming from different sources. - Fix error for signature mismatch that was only showing the first default argument as having a default. Now it shows for all.
* / GDScript: Improve usability of setter chainsGeorge Marques2023-02-024-0/+12
|/ | | | | | | | | - Consider PackedArrays non-shared since they are copied on C++/script boundaries. - Add error messages in the analyzer when assigning to read-only properties. - Add specific error message at runtime when assignment fails because the property is read-only.
* Revert "GDScript: Add warnings that are set to error by default"Rémi Verschelde2023-02-011-1/+1
| | | | | | | | | This reverts commit a166833bfa23a21a7bff196a85a20b014e7c1396. This caused multiple regressions. Needs to be redone with more testing before merge. Fixes #72501.
* GDScript: Add warnings that are set to error by defaultGeorge Marques2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - Adds a list of default levels for all warning so they can be set individually. - Add warnings set by default to error for: - Using `get_node()` without `@onready`. - Using `@onready` together with `@export`. - Inferring a static type with a Variant value. - Overriding a native engine method. - Adjust how annotations to ignore warnings are treated so they also apply to method parameters. - Clean up a bit how ignored warnings are set. There were two sets but only one was actually being used. - Set all warnings to the `WARN` level for tests, so they they can be properly tested. - Fix enum types in native methods signatures being set to `int`. - Fix native enums being treated as Dictionary by mistake. - Make name of native enum types use the class they are defined in, not the direct super class of the script. This ensures they are always equal even when coming from different sources. - Fix error for signature mismatch that was only showing the first default argument as having a default. Now it shows for all.
* GDScript: Fix issues with typed arraysDmitrii Maganov2023-01-319-1/+26
|
* Merge pull request #72285 from vnen/gdscript-variable-matchRémi Verschelde2023-01-294-0/+14
|\ | | | | GDScript: Allow variables in match patterns
| * GDScript: Allow variables in match patternsGeorge Marques2023-01-284-0/+14
| | | | | | | | To restore an ability available in 3.x and reduce compatibility changes.
* | GDScript: Fix constant conversionsDmitrii Maganov2023-01-2917-24/+16
|/
* GDScript: Allow constant expressions in annotationsDanil Alexeev2023-01-252-0/+8
|
* Merge pull request #71349 from vonagam/disallow-infer-on-weakRémi Verschelde2023-01-256-0/+19
|\ | | | | | | GDScript: Disallow type inference with untyped initializer
| * GDScript: Disallow type inference with untyped initializerDmitrii Maganov2023-01-136-0/+19
| |
* | GDScript: Fix typing of iterator in for loopDmitrii Maganov2023-01-1318-0/+75
|/
* Merge pull request #70733 from vonagam/fix-assigning-untypedRémi Verschelde2023-01-122-0/+5
|\ | | | | | | GDScript: Fix some issues with assignments that involve untyped things
| * GDScript: Fix some issues with assignments that involve untyped thingsDmitrii Maganov2023-01-122-0/+5
| |
* | GDScript: Fix extending abstract classes, forbid their constructionDmitrii Maganov2023-01-124-0/+15
|/
* GDScript: Fix getting type from PropertyInfo for Variant argumentsDmitrii Maganov2023-01-122-9/+0
|
* Add GDScript `.editorconfig` rulesAdam Scott2023-01-104-11/+12
| | | | - Uniformize `.gd` unit test files indentation to tabs (where needed)
* Merge pull request #71140 from vonagam/fix-const-index-subscript-typeRémi Verschelde2023-01-102-0/+7
|\ | | | | GDScript: Fix type for index subscript on constant
| * GDScript: Fix type for index subscript on constantDmitrii Maganov2023-01-102-0/+7
| |
* | Fix GDScript base and outer classes, signals and functions lookup orderAdam Scott2023-01-098-0/+58
|/ | | | | | | - Add outer class lookup test - Add signal lookup test Co-authored-by: Dmitrii Maganov <vonagam@gmail.com>
* Merge pull request #71051 from vonagam/consts-are-deep-startRémi Verschelde2023-01-094-0/+14
|\ | | | | GDScript: Begin making constants deep, not shallow or flat
| * GDScript: Begin making constants deep, not shallow or flatDmitrii Maganov2023-01-084-0/+14
| |
* | Assorted enum and native type fixesocean (they/them)2023-01-0939-5/+131
|/
* GDScript: Fix typing of lambda functionsDmitrii Maganov2023-01-064-0/+12
|
* Unify typing of variables, constants and parameters in GDScriptDmitrii Maganov2023-01-063-3/+3
|
* Merge pull request #70702 from vnen/gdscript-error-on-assign-voidRémi Verschelde2023-01-0310-0/+25
|\ | | | | | | GDScript: Error when assigning return value of void function
| * GDScript: Make using return of void function an errorGeorge Marques2022-12-3010-0/+25
| | | | | | | | | | Remove the `VOID_ASSIGNMENT` warning since those cases will be errors now.
* | Merge pull request #70656 from vonagam/fix-void-returnsRémi Verschelde2023-01-034-0/+10
|\ \ | | | | | | | | | GDScript: Disallow return with value in void functions
| * | GDScript: Disallow return with value in void functionsDmitrii Maganov2022-12-294-0/+10
| |/
* / GDScript: Fix return type of constructor call for extending classDmitrii Maganov2022-12-272-0/+12
|/
* Add MethodInfo to signal datatypeocean (they/them)2022-12-212-0/+6
|
* Fix outer class lookupAdam Scott2022-12-172-0/+14
|
* GDScript: Allow out of order member resolutionrune-scape2022-12-1418-1/+75
|
* Unify String and StringNamerune-scape2022-12-052-0/+11
|
* Improve parent signature errorkobewi2022-12-015-5/+5
|
* Fix ability to overload "script" variableocean (they/them)2022-11-174-0/+19
|
* Fixes GDScript define nested dictionary and array as constants #50285PastMoments2022-04-191-1/+1
|
* GDScript: Check if method signature matches the parentGeorge Marques2022-03-0610-0/+60
| | | | | | | | | | | | | | 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.
* GDScript: Consolidate behavior for assigning enum typesGeorge Marques2022-02-038-0/+40
| | | | | | | | | | 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.
* GDScript: Fix parsing default parameter values from function callsstrank2022-01-132-0/+11
|
* GDScript: Make setter parameter type same as variable typeGeorge Marques2021-10-122-0/+10
|
* GDScript: Report property type errorsZuBsPaCe2021-10-088-0/+48
| | | | | | | | | 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
* GDScript: Don't allow builtin type names as identifiersGeorge Marques2021-09-298-0/+25
|
* Add more integration tests to the GDScript test suiteHugo Locurcio2021-09-152-2/+2
| | | | This also fixes a typo in the `bitwise_float_right_operand.gd` test.
* GDScript: Allow string keys on Lua-style dictionariesGeorge Marques2021-09-156-0/+24
| | | | | Which is useful when the key isn't a valid identifier, such as keys with spaces or numeric keys.
* Add dozens of new integration tests to the GDScript test suiteHugo Locurcio2021-09-1434-0/+115
This also ignores `.out` files in the file format static checks.