public CodegenExpression EvaluateCodegen(
     Type requiredType,
     CodegenMethodScope codegenMethodScope,
     ExprForgeCodegenSymbol exprSymbol,
     CodegenClassScope codegenClassScope)
 {
     return _widener.WidenCodegen(
         _forge.EvaluateCodegen(requiredType, codegenMethodScope, exprSymbol, codegenClassScope),
         codegenMethodScope,
         codegenClassScope);
 }
Ejemplo n.º 2
0
 public CodegenExpression EvaluateCodegen(
     Type requiredType,
     CodegenMethodScope codegenMethodScope,
     ExprForgeCodegenSymbol exprSymbol,
     CodegenClassScope codegenClassScope)
 {
     CodegenExpression inner = validated.Forge.EvaluateCodegen(
         validated.Forge.EvaluationType,
         codegenMethodScope,
         exprSymbol,
         codegenClassScope);
     return widener.WidenCodegen(inner, codegenMethodScope, codegenClassScope);
 }
Ejemplo n.º 3
0
        public static CodegenExpression CodegenWidener(
            TypeWidenerSPI widener,
            CodegenMethod method,
            Type originator,
            CodegenClassScope classScope)
        {
            var widen = new CodegenExpressionLambda(method.Block).WithParam<object>("input");
            var anonymousClass = NewInstance<ProxyTypeWidener>(widen);

            //var anonymousClass = NewAnonymousClass(method.Block, typeof(TypeWidener));
            //var widen = CodegenMethod.MakeParentNode(typeof(object), originator, classScope)
            //    .AddParam(typeof(object), "input");
            //anonymousClass.AddMethod("widen", widen);

            var widenResult = widener.WidenCodegen(Ref("input"), method, classScope);
            widen.Block.BlockReturn(widenResult);
            return anonymousClass;
        }