This caused criticals when error_expression is not correct.
semantic/switch-label-not-constant.test \
semantic/switch-type-unsupported.test \
semantic/throw-no-error-type.test \
+ semantic/throw-unknown-error-type.test \
semantic/type-argument-ownership-mismatch.test \
semantic/unary-unsupported-complement.test \
semantic/unary-unsupported-increment.test \
--- /dev/null
+Invalid Code
+
+void foo () throws Error {
+ int bar = 1;
+ switch (bar) {
+ case 0:
+ break;
+ default:
+ throw new FooError.FAIL ("");
+ }
+}
+
+void main () {
+}
}
public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) {
+ if (error) {
+ return;
+ }
if (source_reference == null) {
source_reference = this.source_reference;
}