Forráskód Böngészése

Merge pull request #75605 from anvilfolk/type-base

Make GDScript type not found errors more informative.
Rémi Verschelde 2 éve
szülő
commit
54b0e8123e

+ 0 - 3
modules/gdscript/gdscript_parser.cpp

@@ -4144,9 +4144,6 @@ String GDScriptParser::DataType::to_string() const {
 			}
 			return native_type.operator String();
 		case CLASS:
-			if (is_meta_type) {
-				return GDScript::get_class_static();
-			}
 			if (class_type->identifier != nullptr) {
 				return class_type->identifier->name.operator String();
 			}

+ 6 - 0
modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.gd

@@ -0,0 +1,6 @@
+class InnerClass:
+	pass
+
+func test():
+	var x : InnerClass.DoesNotExist
+	print("FAIL")

+ 2 - 0
modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.out

@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+Could not find type "DoesNotExist" under base "InnerClass".