我有这样的错误:
错误 1“System.Linq.Expressions.Expression”不包含“IfThenElse”的定义
如何省略?
这是代码(用于 C# 的 AluminiumLua 库):
public virtual void IfThenElse()
{
var Else = Expression.Call(stack.Pop(), LuaObject_AsFunction);
var Then = Expression.Call(stack.Pop(), LuaObject_AsFunction);
var Cond = Expression.Call(stack.Pop(), LuaObject_AsBool);
stack.Push(Expression.IfThenElse(
Cond,
Expression.Call(Then, LuaFunction_Invoke, Expression.NewArrayInit(typeof(LuaObject), new Expression[] { })),
Expression.Call(Else, LuaFunction_Invoke, Expression.NewArrayInit(typeof(LuaObject), new Expression[] { }))
));
}