Ejemplo n.º 1
0
 public DecompiledLambdaResolveResult(IL.ILFunction function,
                                      IType delegateType,
                                      IType inferredReturnType,
                                      bool hasParameterList,
                                      bool isAnonymousMethod,
                                      bool isImplicitlyTyped)
 {
     this.function           = function ?? throw new ArgumentNullException(nameof(function));
     this.DelegateType       = delegateType ?? throw new ArgumentNullException(nameof(delegateType));
     this.InferredReturnType = inferredReturnType ?? throw new ArgumentNullException(nameof(inferredReturnType));
     this.HasParameterList   = hasParameterList;
     this.IsAnonymousMethod  = isAnonymousMethod;
     this.IsImplicitlyTyped  = isImplicitlyTyped;
     this.Body = new ResolveResult(SpecialType.UnknownType);
 }
Ejemplo n.º 2
0
            TypeSystemAstBuilder CreateAstBuilder(CSharpTypeResolveContext context, IL.ILFunction function = null)
            {
                CSharpResolver resolver = new CSharpResolver(context);

                if (function != null)
                {
                    foreach (var v in function.Variables)
                    {
                        if (v.Kind != IL.VariableKind.Parameter)
                        {
                            resolver = resolver.AddVariable(new DefaultVariable(v.Type, v.Name));
                        }
                    }
                }

                return(new TypeSystemAstBuilder(resolver)
                {
                    UseNullableSpecifierForValueTypes = settings.LiftNullables,
                    AddResolveResultAnnotations = true,
                    UseAliases = true
                });
            }