Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / dtest-error-04.cs
1 using System;
2 using Microsoft.CSharp.RuntimeBinder;
3
4 class A
5 {
6         public string Value;
7 }
8
9 public class Test
10 {
11         public static int Main ()
12         {
13                 dynamic d = new A ();
14                 
15                 try {
16                         d.Value = (object)"value";
17                         return 1;
18                 } catch (RuntimeBinderException e) {
19                         if (e.Message != "Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)")
20                                 return 2;
21                 }
22                 
23                 return 0;
24         }
25 }