summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/errors
diff options
context:
space:
mode:
authorocean (they/them) <anvilfolk@gmail.com>2023-04-02 18:10:32 -0400
committerocean (they/them) <anvilfolk@gmail.com>2023-04-02 18:30:30 -0400
commit5d164df4e15a4e76feaa187053c05127a98225e1 (patch)
treef5e68fc40f3a2866b597e52a601ac7f1127656f3 /modules/gdscript/tests/scripts/analyzer/errors
parentdf7834ac96398da0cb6b09f77ec010d4dff467f7 (diff)
downloadredot-engine-5d164df4e15a4e76feaa187053c05127a98225e1.tar.gz
Make type not found errors more informative.
This PR removes a check for whether a datatype is a meta type when generating a datatype's to_string() result. This means that error messages that fail to find the type will now print their class names, which is much more useful when trying to identify errors.
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/errors')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.out2
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.gd b/modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.gd
new file mode 100644
index 0000000000..e56ae7b11d
--- /dev/null
+++ b/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")
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.out b/modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.out
new file mode 100644
index 0000000000..29c75ae3c0
--- /dev/null
+++ b/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".