966bba02bb
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
26 lines
425 B
C#
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;
|
|
}
|
|
}
|