diff options
author | Marek Safar <marek.safar@gmail.com> | 2009-09-08 23:29:20 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2009-09-08 23:29:20 +0400 |
commit | e177c78c7d1bdbe3ccd292a938ee726c1fb871a1 (patch) | |
tree | df2af92617bb5bd5e63d0304bd89b7fb17cdbfb8 /mcs/errors | |
parent | bf242cd0b1a48ee70350179a2237b36544d24fd4 (diff) |
New tests.
svn path=/trunk/mcs/; revision=141540
Diffstat (limited to 'mcs/errors')
-rw-r--r-- | mcs/errors/cs0039-2.cs | 10 | ||||
-rw-r--r-- | mcs/errors/gcs0310-5.cs | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/mcs/errors/cs0039-2.cs b/mcs/errors/cs0039-2.cs new file mode 100644 index 00000000000..f954adf0e8d --- /dev/null +++ b/mcs/errors/cs0039-2.cs @@ -0,0 +1,10 @@ +// CS0039: Cannot convert type `string' to `C' via a built-in conversion +// Line: 8 + +class C +{ + public static void Main () + { + C c = "test" as C; + } +} diff --git a/mcs/errors/gcs0310-5.cs b/mcs/errors/gcs0310-5.cs new file mode 100644 index 00000000000..90a4cd62fe1 --- /dev/null +++ b/mcs/errors/gcs0310-5.cs @@ -0,0 +1,15 @@ +// CS0310: The type `string' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Program.Ret<T>()' +// Line: 10 + +public static class Program +{ + static void Main () + { + Ret<string> (); + } + + static T Ret<T> () where T : new () + { + return new T (); + } +} |