Skip to content

Commit 8b3e3da

Browse files
committed
fix: Casting to BuiltinType
1 parent 7ca30df commit 8b3e3da

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/cpp/editor/godot_dart_editor_plugin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class GodotDartEditorPlugin : public godot::EditorPlugin {
1515
GodotDartEditorPlugin();
1616
~GodotDartEditorPlugin();
1717

18-
virtual void _enter_tree() override;
19-
virtual void _exit_tree() override;
18+
void _enter_tree() override;
19+
void _exit_tree() override;
2020

2121
bool run_pub_get();
2222
bool run_build_runner();

src/cpp/script/dart_script.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ bool DartScript::_is_tool() const {
249249

250250
godot::StringName DartScript::_get_instance_base_type() const {
251251
GodotDartBindings *bindings = GodotDartBindings::instance();
252-
if (bindings == nullptr || _dart_type == nullptr) {
252+
if (bindings == nullptr) {
253+
return godot::StringName();
254+
}
255+
const_cast<DartScript *>(this)->refresh_type(false);
256+
if (_dart_type == nullptr) {
253257
return godot::StringName();
254258
}
255259

src/dart/godot_dart/lib/src/variant/variant.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Variant implements Finalizable {
196196
}
197197

198198
T? cast<T>() {
199-
if (T is BuiltinType) {
199+
if (<T>[] is List<BuiltinType>) {
200200
var typeInfo = gde.dartBindings.getGodotTypeInfo(T);
201201
return convertFromVariant(this, typeInfo) as T?;
202202
}

0 commit comments

Comments
 (0)