本文整理汇总了C#中IronPython.Runtime.Binding.PythonBinder.MakeContainsGenericParametersError方法的典型用法代码示例。如果您正苦于以下问题:C# PythonBinder.MakeContainsGenericParametersError方法的具体用法?C# PythonBinder.MakeContainsGenericParametersError怎么用?C# PythonBinder.MakeContainsGenericParametersError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronPython.Runtime.Binding.PythonBinder
的用法示例。
在下文中一共展示了PythonBinder.MakeContainsGenericParametersError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeGetExpression
internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
if (Getter.Length != 0 && !Getter[0].IsPublic) {
// fallback to runtime call
base.MakeGetExpression(binder, codeContext, instance, owner, builder);
} else if (NeedToReturnProperty(instance, Getter)) {
builder.FinishCondition(AstUtils.Constant(this));
} else if (Getter[0].ContainsGenericParameters) {
builder.FinishCondition(
DefaultBinder.MakeError(
binder.MakeContainsGenericParametersError(
MemberTracker.FromMemberInfo(_info)
),
typeof(object)
).Expression
);
} else if (instance != null) {
builder.FinishCondition(
AstUtils.Convert(
binder.MakeCallExpression(
new PythonOverloadResolverFactory(binder, codeContext),
Getter[0],
instance
).Expression,
typeof(object)
)
);
} else {
builder.FinishCondition(
AstUtils.Convert(
binder.MakeCallExpression(
new PythonOverloadResolverFactory(binder, codeContext),
Getter[0]
).Expression,
typeof(object)
)
);
}
}
示例2: MakeGetExpression
internal override Expression/*!*/ MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, Expression/*!*/ error) {
if (Getter.Length != 0 && !Getter[0].IsPublic) {
// fallback to runtime call
return base.MakeGetExpression(binder, codeContext, instance, owner, error);
} else if (NeedToReturnProperty(instance, Getter)) {
return AstUtils.Constant(this);
} else if (Getter[0].ContainsGenericParameters) {
return DefaultBinder.MakeError(
binder.MakeContainsGenericParametersError(
MemberTracker.FromMemberInfo(_info)
)
);
}
Expression res;
if (instance != null) {
res = binder.MakeCallExpression(
codeContext,
Getter[0],
instance
);
} else {
res = binder.MakeCallExpression(
codeContext,
Getter[0]
);
}
Debug.Assert(res != null);
return res;
}