diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/semantic/method-override-no-class.test | 14 | ||||
-rw-r--r-- | tests/semantic/method-virtual-no-class-or-interface.test | 11 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index daf2a8cf9..4596d5310 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1234,6 +1234,7 @@ TESTS = \ semantic/method-main-inline.test \ semantic/method-main-throws.test \ semantic/method-override.test \ + semantic/method-override-no-class.test \ semantic/method-postcondition.test \ semantic/method-precondition.test \ semantic/method-private-abstract.test \ @@ -1249,6 +1250,7 @@ TESTS = \ semantic/method-too-many-type-arguments.test \ semantic/method-virtual.test \ semantic/method-virtual-body.test \ + semantic/method-virtual-no-class-or-interface.test \ semantic/methodcall-field-initializer-throws.test \ semantic/methodcall-invalid-argument-lambda.test \ semantic/methodcall-invocation-invalid.test \ diff --git a/tests/semantic/method-override-no-class.test b/tests/semantic/method-override-no-class.test new file mode 100644 index 000000000..f881aa4ea --- /dev/null +++ b/tests/semantic/method-override-no-class.test @@ -0,0 +1,14 @@ +Invalid Code + +class Foo { + public virtual void foo () { + } +} + +interface Bar : Foo { + public override void foo () { + } +} + +void main () { +} diff --git a/tests/semantic/method-virtual-no-class-or-interface.test b/tests/semantic/method-virtual-no-class-or-interface.test new file mode 100644 index 000000000..6b1161fe1 --- /dev/null +++ b/tests/semantic/method-virtual-no-class-or-interface.test @@ -0,0 +1,11 @@ +Invalid Code + +struct Foo { + public int i; + + public virtual void foo () { + } +} + +void main () { +} |