summaryrefslogtreecommitdiff
path: root/mcs/tests/dtest-error-04.cs
blob: b08555808a2011b40f1a1dbea436fab9e9154e93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using Microsoft.CSharp.RuntimeBinder;

class A
{
	public string Value;
}

public class Test
{
	public static int Main ()
	{
		dynamic d = new A ();
		
		try {
			d.Value = (object)"value";
			return 1;
		} catch (RuntimeBinderException e) {
			if (e.Message != "Cannot implicitly convert type `object' to `string'. An explicit conversion exists (are you missing a cast?)")
				return 2;
		}
		
		return 0;
	}
}