Skip to content

Commit

Permalink
fix: Casting to BuiltinType
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzybinary committed Dec 12, 2024
1 parent 7ca30df commit 8b3e3da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cpp/editor/godot_dart_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class GodotDartEditorPlugin : public godot::EditorPlugin {
GodotDartEditorPlugin();
~GodotDartEditorPlugin();

virtual void _enter_tree() override;
virtual void _exit_tree() override;
void _enter_tree() override;
void _exit_tree() override;

bool run_pub_get();
bool run_build_runner();
Expand Down
6 changes: 5 additions & 1 deletion src/cpp/script/dart_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ bool DartScript::_is_tool() const {

godot::StringName DartScript::_get_instance_base_type() const {
GodotDartBindings *bindings = GodotDartBindings::instance();
if (bindings == nullptr || _dart_type == nullptr) {
if (bindings == nullptr) {
return godot::StringName();
}
const_cast<DartScript *>(this)->refresh_type(false);
if (_dart_type == nullptr) {
return godot::StringName();
}

Expand Down
2 changes: 1 addition & 1 deletion src/dart/godot_dart/lib/src/variant/variant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Variant implements Finalizable {
}

T? cast<T>() {
if (T is BuiltinType) {
if (<T>[] is List<BuiltinType>) {
var typeInfo = gde.dartBindings.getGodotTypeInfo(T);
return convertFromVariant(this, typeInfo) as T?;
}
Expand Down

0 comments on commit 8b3e3da

Please sign in to comment.