Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
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.
|
|
GDScript: Add warnings that are set to error by default (take 2)
|
|
- 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.
|
|
- 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.
|
|
This reverts commit a166833bfa23a21a7bff196a85a20b014e7c1396.
This caused multiple regressions.
Needs to be redone with more testing before merge.
Fixes #72501.
|
|
- 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.
|
|
Add hint for identifiers renamed from 3.x to 4.0
|
|
|
|
|
|
Closes https://github.com/godotengine/godot/issues/71065
|
|
|
|
|
|
|
|
|
|
- Add outer class lookup test
- Add signal lookup test
Co-authored-by: Dmitrii Maganov <vonagam@gmail.com>
|
|
GDScript: Begin making constants deep, not shallow or flat
|
|
|
|
|
|
|
|
|
|
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".
|
|
|
|
|
|
|
|
|
|
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
|
|
* 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!
|
|
|
|
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.
|
|
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.
|
|
Happy new year to the wonderful Godot community!
|
|
In the case the call happens as a statement, since the return value
isn't used in this case.
|
|
|
|
|
|
|
|
|
|
- Lambdas are always callables (no specific signature match).
- Captures from the current context are evaluated.
|
|
This ensures that annotations that rely on the datatype (such as
@export) can validated it timely, allowing compound expressions instead
of only literal values.
|
|
- Use `Array[type]` for type-hints. e.g.:
`var array: Array[int] = [1, 2, 3]`
- Array literals are typed if their storage is typed (variable
asssignment of as argument in function all). Otherwise they are
untyped.
|
|
Happy new year to the wonderful Godot community!
2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.
We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)
Here's to a great year 2021 for all Godot users 🎆
|
|
GDScript: Improve handling of operators
|
|
- Use the new functions in Variant to determine the validity and resulting
type of operators.
- Split the operator function in codegen between binary and unary, since
the unary ones have now a special requirement of having the second
argument to be the NIL type when requesting info.
|
|
Otherwise this may lead to a crash when the dependency is not present.
|
|
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
|
|
Fix: #41377
Fix: #20436
Fix: #41953
|
|
Fix: #41772
|
|
Since it's likely that they won't parse correctly.
|