Commit Graph

146 Commits

Author SHA1 Message Date
3030d4b806 Object: Add tests about the safety of tail destruction
(cherry picked from commit bb77520599)
2024-09-17 08:57:45 +02:00
b2facc018a Merge pull request #94730 from dalexeev/gds-fix-while-locals-clearing
GDScript: Fix locals clearing after exiting `while` block
2024-07-26 13:44:09 +02:00
8f3e2c96eb [Core] Fix Variant::construct of Object
Variant type was not updated correctly causing leaks in ref-counted
2024-07-25 12:25:29 +02:00
5350e1beaa GDScript: Fix locals clearing after exiting while block 2024-07-25 12:10:37 +03:00
8c82fd15d2 GDScript: Fix incorrect setter call for reference types 2024-07-24 10:37:35 +03:00
c2b91e2986 Merge pull request #94327 from HolonProduction/underscore_identifier
GDScript: Restore support for `Token::UNDERSCORE` in identifiers
2024-07-17 11:44:01 +02:00
aefd91ae42 Merge pull request #94138 from vnen/gdscript-simple-setter-chain-call-setter
GDScript: Call setter on simple setter chain without getter
2024-07-17 11:43:15 +02:00
06e732c3ed GDScript: Restore support for Token::UNDERSCORE in identifiers 2024-07-15 10:04:11 +02:00
87c90a573c GDScript: Call setter on simple setter chain without getter
Fixes a bug where a member variable was being set directly before
calling the setter.
2024-07-09 13:01:59 -03:00
92320c9b73 Merge pull request #94025 from dalexeev/gds-fix-implicit-cast-typed-array-param
GDScript: Fix implicit cast to typed array when passing parameter
2024-07-09 16:47:20 +02:00
daba91d8c6 Merge pull request #93897 from akien-mga/vformat-better-error-message
Core: Improve `vformat` error reporting on `sprintf` failure
2024-07-09 00:03:17 +02:00
f68ab70a6a [GDScript] Fix get_method for lambda self Callables 2024-07-08 18:01:54 +02:00
b4cb7ec2bb GDScript: Fix implicit cast to typed array when passing parameter 2024-07-07 13:43:09 +03:00
aa28782be3 [GDScript] Fix get_argument_count for lambda Callables 2024-07-05 13:53:56 +02:00
496b7b8482 Core: Improve vformat error reporting on sprintf failure
And fix a few occurrences of formatting errors that led me to this.
2024-07-04 10:54:55 +02:00
18d8838051 GDScript: Fix subscript resolution on constant non-metatype GDScript base 2024-05-30 17:37:05 +03:00
4b692959de GDScript: Fix lambdas capturing non-local variables 2024-05-22 10:07:31 +03:00
76b2d85c9f GDScript: Fix some export annotation issues 2024-05-13 17:49:06 +03:00
7d03b1de0b Style: Trim trailing whitespace and ensure newline at EOF
Found by apply the file_format checks again via #91597.
2024-05-08 10:12:46 +02:00
4b070e8031 Fix various typos with codespell
Using 2.2.7.dev217+g10c2abcf.

Had to add `colour` to the ignore list as we used it as an alias/keyword for the
documentation of color-related APIs.
Also ignore recommendations to change `thirdparty` to either `third-party` or
`third party`, which are correct but we use the former fairly consistently.
2024-05-07 10:08:42 +02:00
f9b488508c Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
a7029e4c8a Merge pull request #91364 from vnen/gdscript-implicit-ready-base-first
GDScript: Call implicit ready on base script first
2024-05-02 17:31:32 +02:00
99b702ea3d GDScript: Call implicit ready on base script first
It is generally expected that the base class is called before the
inherited clas. This commit implements this behavior for the implicit
ready function (`@onready` annotation) to make it consistent with the
expectations.
2024-05-02 11:25:52 -03:00
c4e24d2b3b [GDScript] Correctly report invalid read-only access 2024-05-01 12:28:47 +02:00
731ea17dd4 Merge pull request #91192 from vnen/gdscript-validated-native-static-calls
GDScript: Perform validated calls with static methods
2024-05-01 09:55:04 +02:00
273a643145 Merge pull request #89647 from AThousandShips/read_only_dict
[Core] Fix property access on read-only `Dictionary`
2024-05-01 09:54:48 +02:00
2778069025 GDScript: Fix object iterator opcodes 2024-04-26 09:21:55 +03:00
7ca038effa GDScript: Perform validated calls with static methods
When the types are validated at compile time, this type of call runs
faster. It is already used for instance methods, this adds this
optimization to native static methods as well.
2024-04-25 21:19:40 -03:00
4136ed7fc8 GDScript: Fix test reset_uninit_local_vars.gd failure 2024-04-24 20:49:52 +03:00
69a23e64e4 Merge pull request #89990 from dalexeev/gds-reset-uninit-local-vars
GDScript: Fix uninitialized local variables not being reset
2024-04-24 18:54:56 +02:00
ec29c3e784 [Core] Fix property access on read-only Dictionary 2024-04-22 13:57:34 +02:00
f9048fcd7d GDScript: Warn when enum variable has no default
The default will always be set to `0`, so if it's not a valid value in
the enum, the warning is shown.
2024-04-16 11:46:59 -03:00
8611fd8400 Merge pull request #90442 from vnen/gdscript-dont-warn-using-default-builtin
GDScript: Don't warn on unassigned for builtin-typed variables
2024-04-10 17:49:44 +02:00
877802e252 GDScript: Don't warn on unassigned for builtin-typed variables
If the type of a variable is a built-in Variant type, then it will
automatically be assigned a default value based on the type. This means
that the explicit initialization may be unnecessary. Thus this commit
removes the warning in such case.

This also changes the meaning of the unassigned warning to happen when
the variable is used before being assigned, not when it has zero
assignments.
2024-04-10 11:59:57 -03:00
f8ca571efe Merge pull request #84043 from dalexeev/gds-fix-unsafe-cast-warning
GDScript: Fix `UNSAFE_CAST` warning
2024-04-09 22:24:55 +02:00
809c6817be Add tests for signal await with parameters 2024-04-08 19:12:01 +02:00
27d7760f41 GDScript: Fix uninitialized local variables not being reset 2024-03-30 23:25:30 +03:00
db455e5bee [Core] Disconnect one-shot signals before calling callbacks
This prevents infinite recursion with one-shot connections emitting
themselves
2024-03-20 20:24:44 +01:00
a1c476f9d7 Merge pull request #87680 from AThousandShips/the_angry_count
Add methods to get argument count of methods
2024-03-13 22:16:43 +01:00
ef1909fca3 GDScript: Fix @warning_ignore annotation issues 2024-03-12 19:00:06 +03:00
59bcc2888c Add methods to get argument count of methods
Added to:
* `Callable`s
* `Object`s
* `ClassDB`
* `Script(Instance)`s
2024-03-10 11:02:43 +01:00
1e61e42250 [GDScript] Fix some test file paths 2024-03-04 19:11:28 +01:00
d90c9db27f Core: Add Callable.create static method for Variant callables 2024-02-29 10:45:00 +03:00
21ee3716c2 Merge pull request #82122 from dalexeev/gds-add-export-hidden-annotation
GDScript: Add `@export_storage` annotation
2024-02-27 21:22:49 +01:00
081fa324fd set has_type false if it is BUILTIN but Variant::NIL 2024-02-11 13:47:12 +00:00
9572cf5ab2 Merge pull request #86823 from dalexeev/gds-utility-func-as-callable
GDScript: Allow utility functions to be used as `Callable`
2024-01-30 17:47:50 +01:00
b4e08eb752 Allow free() to be used as Callable
This method is registered in a special way so ClassDB doesn't naturally
know about its existence. Here it is hardcoded if any other option fail
to check if it is about the `free()` method and, if so, say it exists
and return a Callable.
2024-01-18 09:33:44 -03:00
b31acb0cd5 GDScript: Allow utility functions to be used as Callable 2024-01-05 21:16:53 +03:00
2bffa3cbc5 Merge pull request #82639 from golfinq/gdscript-improve-indexing-error
GDScript: Improve error messages for invalid indexing
2024-01-04 16:38:58 +01:00
2e1725bef6 Merge pull request #86088 from dalexeev/gds-fix-static-func-as-callable-in-static-context
GDScript: Fix accessing static function as `Callable` in static context
2024-01-02 18:05:16 +01:00