Skip to content

Commit

Permalink
New tests.
Browse files Browse the repository at this point in the history
svn path=/trunk/mcs/; revision=146051
  • Loading branch information
marek-safar committed Nov 12, 2009
1 parent d4ea42a commit 7d1a878
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mcs/errors/dcs0206.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
// Line: 16

using System;

public class Test
{
public static void WriteOutData (out dynamic d)
{
d = 5.0;
}

public static void Main (string[] args)
{
dynamic d = null;
WriteOutData (out d.Foo);
}
}

15 changes: 15 additions & 0 deletions mcs/errors/dcs0308.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS0308: The non-generic method `C.TestCall(int)' cannot be used with the type arguments
// Line: 13

class C
{
static void TestCall (int i)
{
}

public static void Main ()
{
dynamic d = 0;
TestCall<int> (d);
}
}
15 changes: 15 additions & 0 deletions mcs/errors/dcs0411.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS0411: The type arguments for method `C.TestCall<T>(int)' cannot be inferred from the usage. Try specifying the type arguments explicitly
// Line: 13

class C
{
static void TestCall<T> (int i)
{
}

public static void Main ()
{
dynamic d = 0;
TestCall (d);
}
}
15 changes: 15 additions & 0 deletions mcs/errors/dcs1501-2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS1501: No overload for method `this' takes `1' arguments
// Line: 13

public class Blah
{
int this [short id, string v] {
set {}
}

public void Test ()
{
dynamic d = 1;
this [d] = 1;
}
}
15 changes: 15 additions & 0 deletions mcs/errors/dcs1501.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS1501: No overload for method `TestCall' takes `1' arguments
// Line: 13

class C
{
static void TestCall (byte b, int a)
{
}

public static void Main ()
{
dynamic d = 0;
TestCall (d);
}
}
15 changes: 15 additions & 0 deletions mcs/errors/dcs1502.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS1502: The best overloaded method match for `C.TestCall(int, string)' has some invalid arguments
// Line: 13

class C
{
static void TestCall (int i, string s)
{
}

public static void Main ()
{
dynamic d = 0;
TestCall (d, 1);
}
}
15 changes: 15 additions & 0 deletions mcs/errors/dcs1593.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// CS1593: Delegate `System.Action<int>' does not take `2' arguments
// Line: 13

using System;

public class Test
{
public static void Main ()
{
Action<int> a = (i) => {};

dynamic d = 1;
a (d, true);
}
}
18 changes: 18 additions & 0 deletions mcs/errors/dcs1729.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// CS1729: The type `C' does not contain a constructor that takes `2' arguments
// Line: 16

class C
{
public C (int i)
{
}
}

public class Blah
{
public static void Main ()
{
dynamic d = 1;
var r = new C (1, d);
}
}

0 comments on commit 7d1a878

Please sign in to comment.