Commit Graph

94 Commits

Author SHA1 Message Date
Danil Alexeev 8122a27eac GDScript: Fix access non-static members in static context 2024-05-01 19:55:40 +03:00
Rémi Verschelde 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
Rémi Verschelde 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
Danil Alexeev 6e996a597f GDScript: Fix UNSAFE_CAST warning 2023-10-27 12:42:00 +03:00
Danil Alexeev 7f4721a941 GDScript: Fix non-static call is allowed in static var lambda body 2023-10-20 20:43:07 +03:00
Danil Alexeev 0c2202c56e GDScript: Fix incorrect error message for utility functions 2023-10-16 14:09:57 +03:00
Danil Alexeev 9e2273abc7 GDScript: Add error when exporting node in non [Node]-derived classes 2023-10-05 13:50:26 +03:00
Rémi Verschelde 5efbed51cc GDScript: Improve error messages for invalid indexing
These errors are very common when using an invalid property name
or calling on an object of the wrong type, and the previous message
was a bit cryptic for users.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Co-authored-by: golfinq <golfinqz@gmail.com>
2023-10-02 14:23:11 -04:00
Yuri Sizov b25f1f9c79 Merge pull request #82477 from dalexeev/gds-covariance-and-contravariance
GDScript: Add return type covariance and parameter type contravariance
2023-09-28 20:04:37 +02:00
Yuri Sizov 73252669b1 Merge pull request #82030 from dalexeev/gds-make-for-loop-array-literal-typed
GDScript: Make array literal typed if `for` loop variable type is specified
2023-09-28 20:04:12 +02:00
Yuri Sizov 813cd1dfc8 Merge pull request #80085 from vnen/gdscript-pattern-guards
GDScript: Implement pattern guards for match statement
2023-09-28 20:03:57 +02:00
Danil Alexeev cb8b89fd95 GDScript: Add return type covariance and parameter type contravariance 2023-09-28 12:27:36 +03:00
Yuri Sizov aa474c9feb Merge pull request #75988 from dalexeev/gds-unsafe-call-argument
GDScript: Improve call analysis
2023-09-27 19:07:46 +02:00
George Marques 54a1414500 GDScript: Implement pattern guards for match statement
Within a match statement, it is now possible to add guards in each
branch:

	var a = 0
	match a:
		0 when false: print("does not run")
		0 when true: print("but this does")

This allows more complex logic for deciding which branch to take.
2023-09-27 11:25:25 -03:00
Danil Alexeev 10b00bc2ea GDScript: Prevent constructing and inheriting engine singletons 2023-09-22 17:30:00 +03:00
Danil Alexeev e8696f9961 GDScript: Improve call analysis
* Add missing `UNSAFE_CALL_ARGUMENT` warning.
* Fix `Object` constructor.
* Display an error for non-existent static methods.
2023-09-21 13:36:39 +03:00
Danil Alexeev 3c35e7f1d6 GDScript: Make array literal typed if for loop variable type is specified 2023-09-21 11:25:59 +03:00
ocean (they/them) 729c9b4d4b GDScript: Add check for super() methods not being implemented 2023-09-17 16:21:28 -04:00
Rémi Verschelde 5c43e4c1ef Fix various typos with codespell
Using 2.2.6.dev180+ge3a2cfbd.
2023-09-12 08:54:18 +02:00
Yuri Sizov b6c4efe1b1 Merge pull request #80964 from dalexeev/gds-allow-use-local-consts-as-types
GDScript: Allow use local constants as types
2023-08-25 21:26:44 +02:00
Danil Alexeev 68a567bd13 GDScript: Allow use local constants as types 2023-08-25 17:04:04 +03:00
Danil Alexeev 89429b0273 GDScript: Fix lambda resolution with cyclic references 2023-08-25 16:29:11 +03:00
Danil Alexeev 6c59ed9485 GDScript: Add static typing for for loop variable 2023-08-17 20:54:34 +03:00
Danil Alexeev 0f27c4ad80 GDScript: Check get_node() shorthand in static functions 2023-08-09 17:11:38 +03:00
Danil Alexeev d53fc92b4c GDScript: Fix bug with identifier shadowed below in current scope 2023-07-26 11:26:57 +03:00