a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
33 lines
503 B
C#
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
|
|
{
|
|
}
|