linux-packaging-mono/mcs/tests/dtest-error-04.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

26 lines
425 B
C#

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;
}
}