From f28b82e9e2161a71060ae6fb410097ae6d23ecaa Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 27 Dec 2007 09:37:12 +0000 Subject: [PATCH] New tests. svn path=/trunk/mcs/; revision=91922 --- mcs/errors/cs1501-2.cs | 22 ++++++++++++++++++++++ mcs/errors/gcs0019-7.cs | 9 +++++++++ mcs/errors/gcs0458.cs | 11 +++++++++++ mcs/errors/gcs1501-3.cs | 17 +++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 mcs/errors/cs1501-2.cs create mode 100644 mcs/errors/gcs0019-7.cs create mode 100644 mcs/errors/gcs0458.cs create mode 100644 mcs/errors/gcs1501-3.cs diff --git a/mcs/errors/cs1501-2.cs b/mcs/errors/cs1501-2.cs new file mode 100644 index 00000000000..dfb0ef443cf --- /dev/null +++ b/mcs/errors/cs1501-2.cs @@ -0,0 +1,22 @@ +// CS1501: No overload for method `Foo' takes `0' arguments +// Line: 20 + +class A +{ + protected virtual void Foo (object[] arr) + { + } +} + +class B : A +{ + protected override void Foo (params object[] arr) + { + } + + static void Bar() + { + B b = new B (); + b.Foo (); + } +} diff --git a/mcs/errors/gcs0019-7.cs b/mcs/errors/gcs0019-7.cs new file mode 100644 index 00000000000..e583c04aaad --- /dev/null +++ b/mcs/errors/gcs0019-7.cs @@ -0,0 +1,9 @@ +// CS0019: Operator `??' cannot be applied to operands of type `null' and `anonymous method' +// Line: 8 + +delegate void D (); + +class F +{ + D d = null ?? delegate { }; +} diff --git a/mcs/errors/gcs0458.cs b/mcs/errors/gcs0458.cs new file mode 100644 index 00000000000..d504a580e6b --- /dev/null +++ b/mcs/errors/gcs0458.cs @@ -0,0 +1,11 @@ +// CS0458: The result of the expression is always `null' of type `bool?' +// Line: 8 +// Compiler options: -warnaserror -warn:2 + +class C +{ + static void Foo() + { + bool? b = null as bool?; + } +} diff --git a/mcs/errors/gcs1501-3.cs b/mcs/errors/gcs1501-3.cs new file mode 100644 index 00000000000..a8f4e9e1a5f --- /dev/null +++ b/mcs/errors/gcs1501-3.cs @@ -0,0 +1,17 @@ +// CS1501: No overload for method `Foo' takes `0' arguments +// Line: 15 + +class Base +{ + protected virtual void Foo (U u) + { + } +} + +class Derived : Base +{ + protected override void Foo (U u) + { + base.Foo (); + } +} -- 2.25.1