From 5d164df4e15a4e76feaa187053c05127a98225e1 Mon Sep 17 00:00:00 2001 From: "ocean (they/them)" Date: Sun, 2 Apr 2023 18:10:32 -0400 Subject: 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. --- .../tests/scripts/analyzer/errors/prints_base_type_not_found.gd | 6 ++++++ .../tests/scripts/analyzer/errors/prints_base_type_not_found.out | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/prints_base_type_not_found.out (limited to 'modules/gdscript/tests/scripts/analyzer/errors') 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". -- cgit v1.2.3