semantic/constant-value-type.test \
semantic/constant-void.test \
semantic/construct-without-gobject.test \
+ semantic/creation-error-accessibility.test \
+ semantic/delegate-error-accessibility.test \
semantic/delegate-return-valist.test \
semantic/delegate-too-few-type-arguments.test \
semantic/delegate-too-many-type-arguments.test \
--- /dev/null
+Invalid Code
+
+errordomain FooError {
+ BAR
+}
+
+public class Foo {
+ public Foo () throws FooError {
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+errordomain FooError {
+ BAR
+}
+
+public delegate void Foo () throws FooError;
+
+void main () {
+}
foreach (DataType error_type in get_error_types ()) {
error_type.check (context);
+
+ // check whether error type is at least as accessible as the creation method
+ if (!context.analyzer.is_type_accessible (this, error_type)) {
+ error = true;
+ Report.error (source_reference, "error type `%s' is less accessible than creation method `%s'".printf (error_type.to_string (), get_full_name ()));
+ return false;
+ }
}
foreach (Expression precondition in get_preconditions ()) {
foreach (DataType error_type in get_error_types ()) {
error_type.check (context);
+
+ // check whether error type is at least as accessible as the delegate
+ if (!context.analyzer.is_type_accessible (this, error_type)) {
+ error = true;
+ Report.error (source_reference, "error type `%s' is less accessible than delegate `%s'".printf (error_type.to_string (), get_full_name ()));
+ return false;
+ }
}
context.analyzer.current_source_file = old_source_file;