public GenericConstructionChecker(TypeSystemServices tss, Node constructionNode, IType[] typeArguments, CompilerErrorCollection errorCollection) { _tss = tss; _constructionNode = constructionNode; _typeArguments = typeArguments; _errors = errorCollection; }
public GenericConstructionChecker(TypeSystemServices tss, Node constructionNode, TypeReferenceCollection argumentNodes, CompilerErrorCollection errorCollection) { _tss = tss; _constructionNode = constructionNode; _argumentNodes = argumentNodes; _errors = errorCollection; }
public ArrayType(TypeSystemServices tagManager, IType elementType, int rank) { _array = tagManager.ArrayType; _elementType = elementType; _rank = rank; _enumerable = tagManager.IEnumerableGenericType; }
/// <summary> /// Constrcuts a new GenericMapping for a specific mapping of generic parameters to type arguments. /// </summary> /// <param name="parameters">The generic parameters that should be mapped.</param> /// <param name="arguments">The type arguments to map generic parameters to.</param> protected GenericMapping(TypeSystemServices tss, IGenericParameter[] parameters, IType[] arguments) { _tss = tss; for (int i = 0; i < parameters.Length; i++) { _map.Add(parameters[i], arguments[i]); } }
public ExternalGenericParameter(TypeSystemServices tss, Type type) : base(tss, type) { if (type.DeclaringMethod != null) { _declaringMethod = (IMethod)tss.Map(type.DeclaringMethod); } }
public NamespaceEntity(INamespace parent, TypeSystemServices tagManager, string name) { _parent = parent; _typeSystemServices = tagManager; _name = name; _assemblies = new Dictionary<Assembly, Dictionary<string, List<Type>>>(AssemblyEqualityComparer.Default); _childrenNamespaces = new Dictionary<string, NamespaceEntity>(); _internalModules = new List<ModuleEntity>(); _externalModules = new List<ExternalType>();
public ModuleEntity(NameResolutionService nameResolutionService, TypeSystemServices typeSystemServices, Module module) { _nameResolutionService = nameResolutionService; _typeSystemServices = typeSystemServices; _module = module; _namespace = SafeNamespace(module); }
public GenericConstructedMethod(TypeSystemServices tss, IMethod definition, IType[] arguments) { _tss = tss; _definition = definition; _genericArguments = arguments; _genericMapping = new GenericMapping(tss, this, arguments); _fullyConstructed = IsFullyConstructed(); }
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration) { _tss = tss; _declaration = declaration; // Determine and remember declaring type and declaring method (if applicable) _declaringMethod = declaration.ParentNode as Method; _declaringType = ( _declaringMethod == null ? declaration.ParentNode as TypeDefinition : _declaringMethod.DeclaringType); }
internal AnonymousCallableType(TypeSystemServices services, CallableSignature signature) { if (null == services) { throw new ArgumentNullException("services"); } if (null == signature) { throw new ArgumentNullException("signature"); } _typeSystemServices = services; _signature = signature; }
internal InternalMethod(TypeSystemServices typeSystemServices, Method method) { _typeSystemServices = typeSystemServices; _method = method; if (method.NodeType != NodeType.Constructor && method.NodeType != NodeType.Destructor) { if (null == _method.ReturnType) { IType returnType = _method.DeclaringType.NodeType == NodeType.ClassDefinition ? Unknown.Default : (IType)_typeSystemServices.VoidType; _method.ReturnType = _typeSystemServices.CodeBuilder.CreateTypeReference(method.LexicalInfo, returnType); } } }
public ReferenceExpression CreateReference(ParameterDeclaration parameter) { return(CreateReference((InternalParameter)TypeSystemServices.GetEntity(parameter))); }
public ReferenceExpression CreateReference(LexicalInfo li, System.Type type) { return(CreateReference(li, TypeSystemServices.Map(type))); }
public TypeReference CreateTypeReference(Type type) { return(CreateTypeReference(TypeSystemServices.Map(type))); }
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration, AbstractInternalType declaringType, int position) : this(tss, declaration, position) { _declaringType = declaringType; }
public ExternalParameter(TypeSystemServices service, ParameterInfo parameter) { _typeSystemServices = service; _parameter = parameter; }
public InternalProperty(TypeSystemServices tagManager, Property property) { _typeSystemServices = tagManager; _property = property; }
public ExternalConstructor(TypeSystemServices manager, ConstructorInfo ci) : base(manager, ci) { }
public ArrayType(TypeSystemServices tagManager, IType elementType) : this(tagManager, elementType, 1) { }
public InternalEvent(TypeSystemServices tagManager, Event event_) { _event = event_; }
public AbstractExternalGenericInfo(TypeSystemServices tss) { _tss = tss; }
internal ExternalMethod(TypeSystemServices manager, MethodBase mi) { _typeSystemServices = manager; _mi = mi; }
private static IMethod GetNoArgsNoVoid(IEnumerable <IEntity> value, TypeSystemServices tss) { return(value.Cast <IMethod>().SingleOrDefault(m => ((m.GetParameters().Length == 0) || (m.IsExtension && m.GetParameters().Length == 1)) && m.ReturnType != tss.VoidType)); }
private static IMethod GetNoArgs(IEnumerable <IEntity> value, TypeSystemServices tss) { return(value.Cast <IMethod>().SingleOrDefault(m => m.GetParameters().Length == 0)); }
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration, InternalMethod declaringMethod, int position) : this(tss, declaration, position) { _declaringMethod = declaringMethod; }
private int CalculateArgumentScore(IType parameterType, IType argumentType) { if (parameterType == argumentType || (TypeSystemServices.IsSystemObject(argumentType) && TypeSystemServices.IsSystemObject(parameterType))) { return(parameterType is ICallableType ? CallableExactMatchScore : ExactMatchScore); } if (TypeCompatibilityRules.IsAssignableFrom(parameterType, argumentType)) { var callableType = parameterType as ICallableType; var callableArg = argumentType as ICallableType; if (callableType != null && callableArg != null) { return(CalculateCallableScore(callableType, callableArg)); } return(UpCastScore); } if (TypeSystemServices.FindImplicitConversionOperator(argumentType, parameterType) != null) { return(ImplicitConversionScore); } if (TypeSystemServices.CanBeReachedByPromotion(parameterType, argumentType)) { return(IsWideningPromotion(parameterType, argumentType) ? WideningPromotion : NarrowingPromotion); } if (MyDowncastPermissions().CanBeReachedByDowncast(parameterType, argumentType)) { return(DowncastScore); } return(-1); }
internal InternalClass(TypeSystemServices manager, TypeDefinition typeDefinition) : base(manager, typeDefinition) { }
internal InternalEnum(TypeSystemServices tagManager, EnumDefinition enumDefinition) : base(tagManager, enumDefinition) { }
internal ExternalType(TypeSystemServices tss, Type type) { if (null == type) throw new ArgumentException("type"); _typeSystemServices = tss; _type = type; }
public InternalProperty(TypeSystemServices typeSystemServices, Property property) { _typeSystemServices = typeSystemServices; _property = property; }
public DeclarationsNamespace(INamespace parent, TypeSystemServices tagManager, DeclarationCollection declarations) { _parent = parent; _declarations = declarations; }
internal InternalCallableType(TypeSystemServices typeSystemServices, TypeDefinition typeDefinition) : base(typeSystemServices, typeDefinition) { }
internal ExternalCallableType(TypeSystemServices typeSystemServices, Type type) : base(typeSystemServices, type) { _invoke = typeSystemServices.Map(type.GetMethod("Invoke")); }
/// <summary> /// Constructs a new generic mapping between a generic method and one of its constructed methods. /// </summary> public GenericMapping(TypeSystemServices tss, IMethod constructedMethod, IType[] arguments) : this(tss, constructedMethod.ConstructedInfo.GenericDefinition.GenericInfo.GenericParameters, arguments) { _constructedOwner = constructedMethod; _genericSource = constructedMethod.ConstructedInfo.GenericDefinition; }
public MethodInvocationExpression CreateMethodInvocation(MethodInfo staticMethod, Expression arg0, Expression arg1) { return(CreateMethodInvocation(TypeSystemServices.Map(staticMethod), arg0, arg1)); }
public InternalGenericMethod(TypeSystemServices tss, Method method) : base(tss, method) { }
public TypeReference CreateTypeReference(LexicalInfo li, Type type) { return(CreateTypeReference(li, TypeSystemServices.Map(type))); }
public ExternalGenericMethodDefinitionInfo(TypeSystemServices tss, ExternalMethod method) : base(tss) { _method = method; }
public BinaryExpression CreateAssignment(Expression lhs, Expression rhs) { return(CreateBoundBinaryExpression(TypeSystemServices.GetExpressionType(lhs), BinaryOperatorType.Assign, lhs, rhs)); }
internal InternalInterface(TypeSystemServices manager, TypeDefinition typeDefinition) : base(manager, typeDefinition) { }
protected IType ArgumentType(Expression e) { return(TypeSystemServices.GetExpressionType(e)); }
public InternalConstructor(TypeSystemServices typeSystemServices, Constructor constructor) : base(typeSystemServices, constructor) { }
public ExternalEntity(TypeSystemServices typeSystemServices, T memberInfo) { _typeSystemServices = typeSystemServices; _memberInfo = memberInfo; }
public InternalEnumMember(TypeSystemServices tagManager, EnumMember member) { _member = member; }
internal VoidTypeImpl(TypeSystemServices typeSystemServices) : base(typeSystemServices, Types.Void) { }
protected AbstractInternalType(TypeSystemServices typeSystemServices, TypeDefinition typeDefinition) { _typeSystemServices = typeSystemServices; _typeDefinition = typeDefinition; }
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration, int position) : this(tss, declaration) { _position = position; }
public RaiseStatement RaiseException(LexicalInfo lexicalInfo, IConstructor exceptionConstructor, params Expression[] args) { Debug.Assert(TypeSystemServices.IsValidException(exceptionConstructor.DeclaringType)); return(new RaiseStatement(lexicalInfo, CreateConstructorInvocation(lexicalInfo, exceptionConstructor, args))); }
public DeclarationsNamespace(INamespace parent, TypeSystemServices tagManager, Declaration declaration) { _parent = parent; _declarations = new DeclarationCollection(); _declarations.Add(declaration); }
public Expression CreateTypeofExpression(System.Type type) { return(CreateTypeofExpression(TypeSystemServices.Map(type))); }
public ExternalConstructedTypeInfo(TypeSystemServices tss, ExternalType type) { _type = type; _tss = tss; }
public MethodInvocationExpression CreateMethodInvocation(Expression target, MethodInfo method) { return(CreateMethodInvocation(target, TypeSystemServices.Map(method))); }
public ExternalConstructedMethodInfo(TypeSystemServices tss, ExternalMethod method) { _method = method; _tss = tss; }
public ExternalGenericTypeInfo(TypeSystemServices tss, ExternalType type) : base(tss) { _type = type; }