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

33 lines
503 B
C#

using System.Linq.Expressions;
using System;
class C
{
public static int Main ()
{
Expression<Func<bool, IA>> e = (arg) => arg ? new B2 () : (IA) new B1 ();
var cond = (ConditionalExpression) e.Body;
if (cond.NodeType != ExpressionType.Conditional)
return 1;
if (cond.IfTrue.NodeType != ExpressionType.Convert)
return 2;
if (cond.IfFalse.NodeType != ExpressionType.Convert)
return 3;
e.Compile () (true);
return 0;
}
}
interface IA
{
}
class B2 : IA
{
}
class B1 : IA
{
}