diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-08-01 14:32:06 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-08-09 08:44:28 +0200 |
commit | 661f08ea4d92c37a566b388c543240ac71cef6dd (patch) | |
tree | 4528bc32d0f5a5588fae909131f66680cb78b037 /tests/generics | |
parent | e74724d2646b0cda103984f1d6c4045db2262726 (diff) | |
download | vala-661f08ea4d92c37a566b388c543240ac71cef6dd.tar.gz |
vala: Enforce required type-arguments on parameter/return types of callables
This stricter check applies to delegate types in source files only.
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1342
Diffstat (limited to 'tests/generics')
-rw-r--r-- | tests/generics/delegate-return-type-missing.test | 8 | ||||
-rw-r--r-- | tests/generics/method-parameter-type-missing.test | 9 | ||||
-rw-r--r-- | tests/generics/method-return-type-missing.test | 10 | ||||
-rw-r--r-- | tests/generics/signal-return-type-missing.test | 10 |
4 files changed, 37 insertions, 0 deletions
diff --git a/tests/generics/delegate-return-type-missing.test b/tests/generics/delegate-return-type-missing.test new file mode 100644 index 000000000..b2ab8fb95 --- /dev/null +++ b/tests/generics/delegate-return-type-missing.test @@ -0,0 +1,8 @@ +Invalid Code + +delegate T FooFunc<T> (); + +delegate FooFunc BarFunc (); + +void main () { +} diff --git a/tests/generics/method-parameter-type-missing.test b/tests/generics/method-parameter-type-missing.test new file mode 100644 index 000000000..cc4197860 --- /dev/null +++ b/tests/generics/method-parameter-type-missing.test @@ -0,0 +1,9 @@ +Invalid Code + +delegate T FooFunc<T> (); + +void foo (FooFunc f) { +} + +void main () { +} diff --git a/tests/generics/method-return-type-missing.test b/tests/generics/method-return-type-missing.test new file mode 100644 index 000000000..313f53fae --- /dev/null +++ b/tests/generics/method-return-type-missing.test @@ -0,0 +1,10 @@ +Invalid Code + +delegate T FooFunc<T> (); + +FooFunc bar () { + return null; +} + +void main () { +} diff --git a/tests/generics/signal-return-type-missing.test b/tests/generics/signal-return-type-missing.test new file mode 100644 index 000000000..35c77a1dd --- /dev/null +++ b/tests/generics/signal-return-type-missing.test @@ -0,0 +1,10 @@ +Invalid Code + +delegate T FooFunc<T> (); + +class Foo { + public signal FooFunc bar (); +} + +void main () { +} |