diff options
author | Marek Safar <marek.safar@gmail.com> | 2014-09-10 20:22:35 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2014-09-10 21:09:27 +0400 |
commit | 9050d9cba17623fffe575476124a946d7aa2fd8d (patch) | |
tree | eee1c6252000df740e068a58cc113c24e64b7fad /mcs/tests/gtest-623.cs | |
parent | 156c7cf97a011cfa9dd91d69c22cd060819f8a64 (diff) |
[mcs] Remove value type constrained type parameter instantiation optimization to handle parameterless struct constructors
Diffstat (limited to 'mcs/tests/gtest-623.cs')
-rw-r--r-- | mcs/tests/gtest-623.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mcs/tests/gtest-623.cs b/mcs/tests/gtest-623.cs new file mode 100644 index 00000000000..ce9b79d1bd1 --- /dev/null +++ b/mcs/tests/gtest-623.cs @@ -0,0 +1,24 @@ +// Compiler options: -r:gtest-623-lib.dll + +using System; + +public class C +{ + static bool Test<T> () where T : struct, I + { + var t = new T (); + if (t.GetValue () != 3) + return false; + + return true; + } + + public static int Main () + { + if (!Test<S> ()) + return 1; + + Console.WriteLine ("ok"); + return 0; + } +}
\ No newline at end of file |