Skip to content

Commit

Permalink
New tests.
Browse files Browse the repository at this point in the history
svn path=/trunk/mcs/; revision=145520
  • Loading branch information
marek-safar committed Nov 5, 2009
2 parents e4c0627 + 2fe2dd5 commit 30c525f
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 20 deletions.
21 changes: 21 additions & 0 deletions mcs/errors/cs0182-8.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression
// Line: 13

using System;

class AAttribute : Attribute
{
public AAttribute (dynamic X)
{
}
}

[A (Test.B)]
class Test
{
public static dynamic B;

static void Main ()
{
}
}
2 changes: 1 addition & 1 deletion mcs/errors/cs0206-2.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// CS0206: A property or indexer may not be passed as an out or ref parameter
// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
// Line: 22

using System;
Expand Down
2 changes: 1 addition & 1 deletion mcs/errors/cs0206.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// CS0206: A property or indexer `X.P' may not be passed as `ref' or `out' parameter
// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
// Line: 15

class X {
Expand Down
13 changes: 13 additions & 0 deletions mcs/errors/cs1736-2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// CS1763: The expression being assigned to optional parameter `c' must be a constant or default value
// Line: 10

struct S
{
}

class C
{
public static void Test (C c = new S ())
{
}
}
3 changes: 1 addition & 2 deletions mcs/errors/cs1750.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// CS1750: Optional parameter value `a' cannot be converted to parameter type `int'
// CS1750: Optional parameter expression of type `string' cannot be converted to parameter type `int'
// Line: 6
// Compiler options: -langversion:future

public class C
{
Expand Down
14 changes: 0 additions & 14 deletions mcs/errors/cs1763-2.cs

This file was deleted.

17 changes: 17 additions & 0 deletions mcs/errors/cs1975.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// CS1975: The constructor call cannot be dynamically dispatched within constructor initializer
// Line: 14

public class A
{
public A (dynamic arg)
{
}
}

public class B : A
{
public B (dynamic arg)
: base (arg)
{
}
}
14 changes: 14 additions & 0 deletions mcs/errors/dcs1963.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// CS1963: An expression tree cannot contain a dynamic operation
// Line: 12

using System;
using System.Linq.Expressions;

class C
{
public static void Main ()
{
dynamic d = 1;
Expression<Func<int>> e = () => d + 1;
}
}
11 changes: 11 additions & 0 deletions mcs/errors/dcs1976.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// CS1976: The method group `Main' cannot be used as an argument of dynamic operation. Consider using parentheses to invoke the method
// Line: 9

class C
{
public static void Main ()
{
dynamic d = null;
d (Main);
}
}
11 changes: 11 additions & 0 deletions mcs/errors/dcs1977.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// CS1977: An anonymous method or lambda expression cannot be used as an argument of dynamic operation without a cast
// Line: 9

class C
{
public static void Main ()
{
dynamic d = null;
d (delegate {});
}
}
11 changes: 11 additions & 0 deletions mcs/errors/dcs1978-2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// CS1978: An expression of type `void' cannot be used as an argument of dynamic operation
// Line: 9

class C
{
public static void Main ()
{
dynamic d = null;
d (Main ());
}
}
12 changes: 12 additions & 0 deletions mcs/errors/dcs1978-3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// CS1978: An expression of type `int*' cannot be used as an argument of dynamic operation
// Line: 9
// Compiler options: -unsafe

unsafe class C
{
public static void Main ()
{
dynamic d = null;
d ((int*)0);
}
}
11 changes: 11 additions & 0 deletions mcs/errors/dcs1978.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// CS1978: An expression of type `__arglist' cannot be used as an argument of dynamic operation
// Line: 9

class C
{
public static void Main ()
{
dynamic d = null;
d (__arglist (111));
}
}
3 changes: 1 addition & 2 deletions mcs/errors/gcs0206.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// CS0206: A property or indexer `anonymous type.Foo' may not be passed as `ref' or `out' parameter
// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
// Line: 14


class C
{
static void Foo (ref object o)
Expand Down
10 changes: 10 additions & 0 deletions mcs/errors/gcs1067.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// CS1067: Partial declarations of `I<T>' must have the same type parameter variance modifiers
// Line: 8

partial interface I<in T>
{
}

partial interface I<out T>
{
}
9 changes: 9 additions & 0 deletions mcs/errors/gcs1750.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// CS1750: Optional parameter expression of type `decimal' cannot be converted to parameter type `int?'
// Line: 6

public class TS
{
public static void Test (int? i = 1m)
{
}
}
11 changes: 11 additions & 0 deletions mcs/errors/gcs1770.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// CS1770: The expression being assigned to nullable optional parameter `d' must be default value
// Line: 8

using System;

class C
{
public static void Foo (DateTime? d = new DateTime ())
{
}
}

0 comments on commit 30c525f

Please sign in to comment.