Commit graph

2574 commits

Author SHA1 Message Date
Danil Alexeev
a98a0f5d34
Document @GDScript.is_instance_of method 2023-02-22 17:06:55 +03:00
Rémi Verschelde
56622b8ec3
Merge pull request #73709 from vonagam/fix-error-message-unfound-type
GDScript: Fix error message for unfound type
2023-02-21 23:36:29 +01:00
Rémi Verschelde
d4bec5855e
Merge pull request #73705 from anvilfolk/doublewoopsie
Added check for null objects in gdscript typed assign.
2023-02-21 23:36:06 +01:00
Rémi Verschelde
49c1902a04
Merge pull request #73689 from vnen/gdscript-fix-inheritance-native-class
GDScript: Fix setting native type with script inheritance
2023-02-21 23:35:18 +01:00
Dmitrii Maganov
2a08739f30 GDScript: Fix error message for unfound type 2023-02-21 23:00:29 +02:00
ocean (they/them)
9ddf482a06 Added check for null objects in gdscript typed assign. 2023-02-21 15:29:07 -05:00
Rémi Verschelde
253396ba39
Merge pull request #73693 from vnen/gdscript-fix-script-signature-check
GDScript: Fix override signature check of script inheritance
2023-02-21 21:19:39 +01:00
Rémi Verschelde
31726fa945
Merge pull request #73680 from vnen/gdscript-div-by-zero-crash-fix
GDScript: Avoid validated division operation to test for zero
2023-02-21 21:19:15 +01:00
George Marques
1731010774
GDScript: Fix override signature check of script inheritance
Avoid treating the super class as a meta type for signature check, since
it is looking at the instance level for that.
2023-02-21 14:37:08 -03:00
George Marques
d076c76551
GDScript: Fix setting native type with script inheritance
Sometimes the inheritance tree is compiled out of order and the base
don't have yet a native type set. This is now changed to not rely on the
base script but use the native type set in the datatype, which is
already resolved by the analyzer.
2023-02-21 14:09:10 -03:00
George Marques
0866e6af2d
GDScript: Avoid validated division operation to test for zero
The validated operations for integer division and modulo do not check
for division by zero. This avoids validated operation in these cases to
make sure the check is performed and avoid crashing the engine.
2023-02-21 11:12:45 -03:00
George Marques
91b93465d5
GDScript: Fix crash when autoload script can't be found 2023-02-21 10:45:24 -03:00
mashumafi
8eb837dc3d Add test for const class references 2023-02-20 23:01:32 -05:00
George Marques
c9e49c487d
GDScript: Limit recursion depth for completion functions
Avoid crashing if the completion gets stuck in infinite recursion while
trying to guess the expression type.
2023-02-20 14:55:13 -03:00
Rémi Verschelde
2057d7344e
Merge pull request #73590 from vnen/gdscript-global-scope-enums
Make global scope enums accessible as types in GDScript
2023-02-20 15:41:45 +01:00
Rémi Verschelde
ea2bc9795c
Merge pull request #73544 from mashumafi/fix-func-arg-null
Fix: Func with typed args error when arg is null
2023-02-20 15:41:40 +01:00
Rémi Verschelde
561d949739
Merge pull request #73489 from vonagam/type-check-node
GDScript: Rework type check
2023-02-20 15:41:36 +01:00
Rémi Verschelde
6bf63a3542
Merge pull request #73291 from vonagam/fix-unsafe-weak-binop
GDScript: Fix missing unsafety mark for binary op with weak variables
2023-02-20 15:41:32 +01:00
mashumafi
30d4d3fa5e Fix: Func with typed args error when arg is null 2023-02-19 21:47:48 -05:00
George Marques
75f16b8167
Make global scope enums accessible as types in GDScript
Add functions to CoreConstant so enums can be properly deduced. Also add
the enums in release builds to make consistent with ClassDB enums and
avoid differences in script compilation between debug and release.
2023-02-19 13:00:07 -03:00
Yuri Sizov
78cd5d813b
Merge pull request #73501 from anvilfolk/oopsiedaisy
Fix inability to assign null regression
2023-02-18 04:38:47 +03:00
Yuri Sizov
24344de4f5
Merge pull request #73448 from RandomShaper/fix_sticky_stack
Avoid GDScript bookkeeping from referencing objects longer than necessary
2023-02-17 23:22:20 +03:00
Pedro J. Estébanez
5e9400fa50 Avoid GDScript bookkeeping from referencing objects longer than necessary 2023-02-17 18:59:17 +01:00
Dmitrii Maganov
8fe023ad93 GDScript: Rework type check 2023-02-17 19:57:18 +02:00
ocean (they/them)
9eb4d1e4bf Fix inability to assign null regression
Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
2023-02-17 11:45:56 -05:00
Yuri Sizov
6212da66e8
Merge pull request #72867 from vnen/gdscript-limit-call-depth
GDScript: Add limit to call depth
2023-02-17 17:00:46 +03:00
Yuri Sizov
6e0dd6beca
Merge pull request #72925 from vonagam/fix-enum-typed-array-error
GDScript: Fix error about enum typed arrays
2023-02-17 16:47:50 +03:00
Rémi Verschelde
68807165f4
Merge pull request #73398 from anvilfolk/fix-getter
Fix unset getter return types resulting in strange behavior
2023-02-17 00:31:42 +01:00
Rémi Verschelde
a845553898
Merge pull request #73364 from anvilfolk/fix-freed
Fix crash by freed object assign to typed variable
2023-02-17 00:31:19 +01:00
ocean (they/them)
c45970739e Fix crash by freed object assign to typed variable 2023-02-16 15:17:46 -05:00
Dmitrii Maganov
5972ba17a4 GDScript: Fix infer on read-only property 2023-02-16 15:50:17 +02:00
ocean (they/them)
94dfac8da7 Add return type for GDScript getters 2023-02-15 17:54:38 -05:00
Danil Alexeev
8d3e682f52
GDScript: Fix default value of exported enum variable 2023-02-14 18:07:50 +03:00
Dmitrii Maganov
df6aae2eca GDScript: Fix missing unsafety mark for binary op with weak variables 2023-02-14 17:01:21 +02:00
Micky
436bbfebe2 Tweak @GlobalScope & GDScript's documentation 2023-02-14 13:26:18 +01:00
Dmitrii Maganov
9cb2da89d6 GDScript: Fix usage of ints with typed array of floats 2023-02-13 22:06:38 +02:00
Rémi Verschelde
d405392847
Revert "Fixed the jumping to function definition using 'Ctrl+LMB'."
This reverts commit 7eb6367d5c.

Fixes #73058.
Fixes #73167.

This caused regressions, we'll retry with fixes for 4.1.
2023-02-13 17:58:59 +01:00
pkowal
be4d8a7b2e
Improve GDScript error for method call on null/previously freed instance
Fixes #53878.
2023-02-12 21:52:05 +01:00
Rémi Verschelde
cb2e73d578
Merge pull request #73033 from akien-mga/gdscript-fix-gd4-renames-build
Clean up ProjectConverter3To4 architecture, move renames map to separate file
2023-02-11 22:05:38 +01:00
Rémi Verschelde
532381562e
Merge pull request #72654 from RandomShaper/ptrcall_ret_raw_obj
Avoid losing references to objects in the native-scripting boundary
2023-02-11 15:35:01 +01:00
Rémi Verschelde
e19e6b09b9
Clean up ProjectConverter3To4 architecture, move renames map to separate file
This allows properly limiting what features depend on the RegEx module
(doing the actual conversion) and what features only require the renames
data (GDScript suggestions).

Also better excludes the conversion command line options when actually
disabling deprecated code.

Fixes #73029.
2023-02-10 14:35:22 +01:00
Danil Alexeev
220898a69f
GDScript: Remove treat_warnings_as_errors project setting 2023-02-10 10:16:33 +03:00
Rémi Verschelde
dc7f08b556
Merge pull request #72971 from vnen/gdscript-multiline-comment
GDScript: Allow strings as multiline comments
2023-02-09 16:19:03 +01:00
Rémi Verschelde
6fca54a81b
Merge pull request #72975 from vnen/gdscript-no-ascii-spoof-check
GDScript: Be more lenient with identifiers
2023-02-09 16:12:09 +01:00
George Marques
03ea77407c
GDScript: Be more lenient with identifiers
- Allow identifiers similar to keywords if they are in ASCII range.
- Allow constants to be treated as regular identifiers.
- Allow keywords that can be used as identifiers in expressions.
2023-02-09 11:19:05 -03:00
George Marques
f95967c299
GDScript: Allow strings as multiline comments
Bring back the behavior in 3.x that was left out by oversight.
2023-02-09 10:16:00 -03:00
Rémi Verschelde
b12bf7ff02
Merge pull request #69550 from Rindbee/fix-script-editor-not-reload-via-lsp
Fix internal editor not updating when using external editor via LSP
2023-02-09 14:01:33 +01:00
Dmitrii Maganov
cedc5fa823 GDScript: Fix error about enum typed arrays 2023-02-09 00:31:40 +02:00
kobewi
e822182bb7 Fix null message in assert() 2023-02-08 20:19:24 +01:00
George Marques
34f0a2ca46
GDScript: Add limit to call depth
The hard limit is set at 2048 depth which seems sensible between
legitimate recursive calls while still avoiding a crash because of a
stack overflow in most of the cases.

Note that it is still possible to reach the stack limit and get an
overflow before reaching a call depth. This is intended as a half-way
measure to stop crashing in most cases, since there's no reliable nor
portable way to check the amount of stack memory left.
2023-02-07 17:09:40 -03:00