summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace most uses of Map by HashMapreduz2022-05-161-4/+4
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-5/+3
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Merge pull request #60396 from vnen/gdscript-self-lambdaRémi Verschelde2022-04-271-14/+54
|\
| * GDScript: Allow using self in lambdasGeorge Marques2022-04-241-14/+54
| |
* | Fixes GDScript define nested dictionary and array as constants #50285PastMoments2022-04-191-0/+20
|/
* GDScript: Add support for static method calls in native typesGeorge Marques2022-04-061-1/+5
|
* Fix typos with codespellRémi Verschelde2022-03-311-1/+1
| | | | | | Using codespell 2.2-dev from current git. Fix a couple incorrect uses of gendered pronouns.
* GDScript: Fix issues with completion and `super` callsGeorge Marques2022-03-301-4/+8
| | | | | | - Make call errors use the call node instead of the calle, which will be empty on super calls. - Don't allow `super()` to be used within lambdas.
* Prevent NARROWING_CONVERSION warning for int(float) function in GDScriptYuri Roubinsky2022-03-221-1/+1
|
* Merge pull request #59056 from Chaosus/gds_fix_extends_crashYuri Rubinsky2022-03-221-0/+1
|\
| * Prevent crash due to empty error message on empty extends in GDScriptYuri Roubinsky2022-03-121-0/+1
| |
* | Fix default value count checking for inherited functionYuri Roubinsky2022-03-141-4/+12
|/
* Restore building web platform by enclosing resolve_function_signature.K. S. Ernest (iFire) Lee2022-03-071-1/+1
|
* GDScript: Check if method signature matches the parentGeorge Marques2022-03-061-8/+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.
* Merge pull request #58185 from V-Sekai/explicit_variant_assignment_fixRémi Verschelde2022-03-041-1/+1
|\
| * Fix error when assigning to an explicitly annotated variant from an ↵SaracenOne2022-02-161-1/+1
| | | | | | | | ambiguous source
* | Merge pull request #58626 from groud/fix_gdscript_analyser_crashRémi Verschelde2022-03-041-3/+9
|\ \
| * | Fix a crash in GDScriptAnalyzer when a script class's file is not foundGilles Roudière2022-02-281-3/+9
| | |
* | | Merge pull request #58262 from Sauermann/fix-range-docMax Hilbrunner2022-03-031-1/+1
|\ \ \ | |/ / |/| | Describe usage of float in range documentation
| * | Describe usage of float in range documentationMarkus Sauermann2022-02-181-1/+1
| |/
* / Fixes cyclic detection from variables assigning themselves to themselves in ↵SaracenOne2022-02-221-28/+38
|/ | | | autocomplete, and restricts initialization of variables from other variables which have not been declared above it in class body
* Refactor some object type checking code with `cast_to`Rémi Verschelde2022-02-081-7/+7
| | | | Less stringly typed logic, and less String allocations and comparisons.
* Merge pull request #57591 from vnen/gdscript-enum-fixesRémi Verschelde2022-02-041-45/+88
|\
| * GDScript: Treat enum values as int and enum types as dictionaryGeorge Marques2022-02-031-29/+66
| | | | | | | | | | | | | | 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.
| * GDScript: Consolidate behavior for assigning enum typesGeorge Marques2022-02-031-20/+26
| | | | | | | | | | | | | | | | | | | | 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.
* | Fix crash with non-constant keys in match statement Dictionary patterncdemirer2022-01-261-1/+1
|/
* Merge pull request #55995 from Xwdit/enum_fixRémi Verschelde2022-01-171-1/+2
|\ | | | | Fix enum int comparison
| * Fix enum int comparisonXwdit2021-12-161-1/+2
| | | | | | | | Fix enum int comparison
* | Merge pull request #56194 from cdemirer/fix-operation-result-type-inferenceRémi Verschelde2022-01-101-8/+20
|\ \
| * | Fix operation result type inferencecdemirer2021-12-231-8/+20
| |/
* | Merge pull request #56232 from V-Sekai/invalid_explicit_variant_assign_fixRémi Verschelde2022-01-101-1/+1
|\ \
| * | Fix 'Compiler bug: unresolved assign' on explicitly annotated variants.SaracenOne2021-12-251-1/+1
| |/
* | Merge pull request #56260 from ↵Rémi Verschelde2022-01-101-6/+7
|\ \ | | | | | | | | | cdemirer/fix-type-mutation-upon-assignment-with-operation
| * | Fix type mutation upon compound assignmentcdemirer2021-12-271-6/+7
| |/
* | Merge pull request #56483 from vnen/gdscript-warning-annotationRémi Verschelde2022-01-051-2/+36
|\ \ | | | | | | Add annotation to ignore warnings
| * | GDScript: Add annotation to ignore warningsGeorge Marques2022-01-041-2/+36
| |/
* / Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Avoid a crash in the gdscript analyserGilles Roudière2021-12-141-2/+4
|
* Fix shadowed global identifier warning duplicationYuri Roubinsky2021-12-131-1/+19
|
* Improve various textskobewi2021-11-231-1/+1
|
* Fix incorrect debug check for settersBenjamin Navarro2021-10-181-1/+1
| | | | | | 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
* Merge pull request #53843 from vnen/gdscript-typed-array-subscript-constantRémi Verschelde2021-10-151-0/+3
|\ | | | | Fix inferred typed array marked as constant
| * GDScript: Fix inferred typed array marked as constantGeorge Marques2021-10-151-0/+3
| |
* | GDScript: Fix typing for await expressionGeorge Marques2021-10-141-3/+12
| | | | | | | | | | 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).
* | GDScript: Remove error when coroutine is called without awaitGeorge Marques2021-10-141-5/+5
|/ | | | | In the case the call happens as a statement, since the return value isn't used in this case.
* Merge pull request #53726 from briansemrau/gd-outer-classGeorge Marques2021-10-141-0/+5
|\ | | | | GDScript 2.0: Access outer scope classes
| * GDScript: Access outer scope classesBrian Semrau2021-10-131-0/+5
| |
* | Merge pull request #53720 from vnen/gdscript-typed-array-custom-classRémi Verschelde2021-10-121-0/+1
|\ \ | |/ |/|
| * GDScript: Fix typed array with custom classesGeorge Marques2021-10-121-0/+1
| |
* | GDScript: Make setter parameter type same as variable typeGeorge Marques2021-10-121-1/+3
|/