2 instantiations of TypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (2)
Symbols\TypeWithAnnotations.cs (2)
167return new TypeWithAnnotations(typeSymbol, nullableAnnotation, Extensions.Create(customModifiers)); 172return new TypeWithAnnotations(defaultType: underlying.DefaultType, nullableAnnotation: NullableAnnotation.Annotated, Extensions.CreateLazy(compilation, underlying));
2310 references to TypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (2011)
Binder\Binder.cs (1)
377internal virtual TypeWithAnnotations GetIteratorElementType()
Binder\Binder.IdentifierUsedAsValueFinder.cs (2)
180unboundLambda.HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType); 186ImmutableArray<TypeWithAnnotations>.Empty,
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (5)
16private readonly TypeWithAnnotations _typeWithAnnotations; 20private NamespaceOrTypeOrAliasSymbolWithAnnotations(TypeWithAnnotations typeWithAnnotations) 36internal TypeWithAnnotations TypeWithAnnotations => _typeWithAnnotations; 61new NamespaceOrTypeOrAliasSymbolWithAnnotations(TypeWithAnnotations.Create(isNullableEnabled, type)); 64public static implicit operator NamespaceOrTypeOrAliasSymbolWithAnnotations(TypeWithAnnotations typeWithAnnotations)
Binder\Binder.QueryUnboundLambdaState.cs (2)
38public override bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType) 56public override TypeWithAnnotations ParameterTypeWithAnnotations(int index) { throw new ArgumentException(); } // implicitly typed
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
99var result = BindMemberOfType(node, node, name, 0, indexed: false, receiver, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), lookupResult, BoundMethodGroupFlags.None, diagnostics);
Binder\Binder_AnonymousTypes.cs (1)
95TypeWithAnnotations.Create(fieldType),
Binder\Binder_Attributes.cs (2)
54var boundType = binder.BindType(attributeToBind.Name, diagnostics); 389var paramType = parameter.TypeWithAnnotations;
Binder\Binder_Await.cs (1)
371var qualified = BindInstanceMemberAccess(node, node, receiver, name, 0, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), invoked: false, indexed: false, diagnostics);
Binder\Binder_Constraints.cs (10)
121ArrayBuilder<TypeWithAnnotations>? constraintTypes = null; 249constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 256var type = BindTypeOrConstraintKeyword(typeSyntax, diagnostics, out ConstraintContextualKeyword keyword); 306return (TypeParameterConstraintClause.Create(constraints, constraintTypes?.ToImmutableAndFree() ?? ImmutableArray<TypeWithAnnotations>.Empty), syntaxBuilder); 371var constraintTypeBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 376var constraintType = constraintTypes[i]; 407TypeWithAnnotations constraintType, 444TypeWithAnnotations type, 446ArrayBuilder<TypeWithAnnotations> constraintTypes, 512static bool isValidConstraintType(TypeParameterSymbol typeParameter, TypeConstraintSyntax syntax, TypeWithAnnotations typeWithAnnotations, bool performOnlyCycleSafeValidation, BindingDiagnosticBag diagnostics)
Binder\Binder_Conversions.cs (2)
877stackAllocType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 954var destType = targetElementTypes[i];
Binder\Binder_Crefs.cs (4)
588foreach (TypeWithAnnotations typeArgument in namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 887var typeArgumentsWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arity); 900var typeArgument = BindType(typeArgumentSyntax, unusedDiagnostics); 940parameterBuilder.Add(new SignatureOnlyParameterSymbol(TypeWithAnnotations.Create(type), ImmutableArray<CustomModifier>.Empty, isParams: false, refKind: refKind));
Binder\Binder_Deconstruct.cs (12)
374return pending.SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(type), this, diagnostics); 380return pending.SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(type)); 476var typesWithAnnotationsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(leftLength); 518typesWithAnnotationsBuilder.Add(TypeWithAnnotations.Create(mergedType)); 550var typesWithAnnotationsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(count); 569typesWithAnnotationsBuilder.Add(TypeWithAnnotations.Create(value.Type)); 655typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>), 751var declType = BindVariableTypeWithAnnotations(component.Designation, diagnostics, component.Type.SkipScoped(out _).SkipRef(), ref isConst, out isVar, out alias); 802TypeWithAnnotations declTypeWithAnnotations, 853TypeWithAnnotations declTypeWithAnnotations) 865TypeWithAnnotations declTypeWithAnnotations, 947var fieldType = field.GetFieldType(this.FieldsBeingBound);
Binder\Binder_Expressions.cs (54)
365var type = new PointerTypeSymbol(TypeWithAnnotations.Create(boundStackAlloc.ElementType)); 895var declType = BindVariableTypeWithAnnotations(node.Designation, diagnostics, node.Type.SkipScoped(out _).SkipRef(), ref isConst, out isVar, out alias); 903private BoundExpression BindDeclarationVariablesForErrorRecovery(TypeWithAnnotations declTypeWithAnnotations, VariableDesignationSyntax node, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics) 905declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 944subExpressions.SelectAsArray(e => TypeWithAnnotations.Create(e.Type)), 979var elementTypesWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arguments.Count); 1011var elementTypeWithAnnotations = TypeWithAnnotations.Create(boundArgument.Type); 1196TypeWithAnnotations typeWithAnnotations = BindType(node.Type, diagnostics); 1337TypeWithAnnotations typeWithAnnotations = typeofBinder.BindType(typeSyntax, diagnostics, out alias); 1361private void CheckDisallowedAttributeDependentType(TypeWithAnnotations typeArgument, Location errorLocation, BindingDiagnosticBag diagnostics) 1390TypeWithAnnotations typeWithAnnotations = this.BindType(typeSyntax, diagnostics, out alias); 1446TypeWithAnnotations typeWithAnnotations = this.BindType(node.Type, diagnostics, out AliasSymbol alias); 1503default(ImmutableArray<TypeWithAnnotations>); 2327TypeWithAnnotations targetTypeWithAnnotations = this.BindType(node.Type, diagnostics); 2488private BoundExpression BindCastCore(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, bool wasCompilerGenerated, BindingDiagnosticBag diagnostics) 2576var targetElementTypesWithAnnotations = default(ImmutableArray<TypeWithAnnotations>); 2631ImmutableArray<TypeWithAnnotations> targetElementTypesWithAnnotations) 2662private BoundExpression BindExplicitNullableCastFromNonNullable(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, BindingDiagnosticBag diagnostics) 2670TypeWithAnnotations underlyingTargetTypeWithAnnotations = targetTypeWithAnnotations.Type.GetNullableUnderlyingTypeWithAnnotations(); 2912var declType = BindVariableTypeWithAnnotations(designation, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 2959var declType = BindVariableTypeWithAnnotations(declarationExpression, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 3176TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3183TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3190TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3195TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3200TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3209TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg); 3220void reportUnsafeIfNeeded(MemberResolutionResult<TMember> methodResult, BindingDiagnosticBag diagnostics, BoundExpression argument, TypeWithAnnotations parameterTypeWithAnnotations) 3239private static TypeWithAnnotations GetCorrespondingParameterTypeWithAnnotations(ref MemberAnalysisResult result, ImmutableArray<ParameterSymbol> parameters, int arg) 3242var type = parameters[paramNum].TypeWithAnnotations; 3430var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank); 3459type: GetStackAllocType(node, TypeWithAnnotations.Create(bestType), diagnostics, out bool hasErrors), 3805var elementType = arrayType.ElementTypeWithAnnotations; 3890private TypeSymbol GetStackAllocType(SyntaxNode node, TypeWithAnnotations elementTypeWithAnnotations, BindingDiagnosticBag diagnostics, out bool hasErrors) 4358typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty, 4431var typeWithAnnotations = BindType(node.Type, diagnostics); 6475ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations = rightHasTypeArguments ? 6477default(ImmutableArray<TypeWithAnnotations>); 6492var typeArgument = typeArgumentsWithAnnotations[i]; 6520/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, TypeSyntax, TypeWithAnnotations, BindingDiagnosticBag, string)"/>. 6595var typeArguments = typeArgumentsSyntax.Count > 0 ? BindTypeArguments(typeArgumentsSyntax, diagnostics) : default(ImmutableArray<TypeWithAnnotations>); 6691ImmutableArray<TypeWithAnnotations> typeArguments, 6765ImmutableArray<TypeWithAnnotations> typeArguments, 6861ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 7076default(ImmutableArray<TypeWithAnnotations>), 7158ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 7235typeWithAnnotations: TypeWithAnnotations.Create(type)); 7274ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 7380ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8418var finalApplicableCandidates = GetCandidatesPassingFinalValidation(syntax, overloadResolutionResult, receiver, default(ImmutableArray<TypeWithAnnotations>), diagnostics); 9188TypeWithAnnotations? returnTypeOverride = null) 9193var returnType = returnTypeOverride ?? methodSymbol.ReturnTypeWithAnnotations; 9274static bool checkConstraints(CSharpCompilation compilation, ConversionsBase conversions, NamedTypeSymbol delegateType, ImmutableArray<TypeWithAnnotations> typeArguments)
Binder\Binder_Invocation.cs (7)
84ImmutableArray<TypeWithAnnotations> typeArgs = default(ImmutableArray<TypeWithAnnotations>), 590ImmutableArray<TypeWithAnnotations> typeArguments; 811ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 1596ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 1731newArguments[i] = ((OutVariablePendingInference)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType), null); 1742newArguments[i] = ((BoundDiscardExpression)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType));
Binder\Binder_Lambda.cs (6)
46ImmutableArray<TypeWithAnnotations> types = default; 49TypeWithAnnotations returnType = default; 122var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 169TypeWithAnnotations type = default; 282private (RefKind, TypeWithAnnotations) BindExplicitLambdaReturnType(TypeSyntax syntax, BindingDiagnosticBag diagnostics) 293var returnType = BindType(syntax, diagnostics);
Binder\Binder_Operators.cs (4)
2522TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(operandType)); 3217var targetTypeWithAnnotations = typeExpression.TypeWithAnnotations; 3297TypeWithAnnotations targetTypeWithAnnotations = BindType(possibleType, bindAsTypeDiagnostics, out AliasSymbol alias); 3620TypeWithAnnotations targetTypeWithAnnotations = BindType(node.Right, diagnostics, out alias);
Binder\Binder_Patterns.cs (12)
332declType: TypeWithAnnotations.Create(narrowedType, NullableAnnotation.NotAnnotated), 849TypeWithAnnotations declType = BindType(typeSyntax, diagnostics, out AliasSymbol aliasOpt); 858TypeWithAnnotations declType, 917private TypeWithAnnotations BindRecursivePatternType( 933return TypeWithAnnotations.Create(inputType.StrippedType(), NullableAnnotation.NotAnnotated); 964TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 979positionalClause, declType, ImmutableArray<TypeWithAnnotations>.Empty, permitDesignations, ref hasErrors, patternsBuilder, diagnostics); 1147ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 1348var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation); 1375addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations>.Empty); 1424void addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations> elementTypes) 1547typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>),
Binder\Binder_Query.cs (8)
56var typeRestriction = BindTypeArgument(fromClause.Type, diagnostics); 397var castType = BindTypeArgument(join.Type, diagnostics); 817new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None); 841private UnboundLambda MakeQueryUnboundLambdaWithCast(RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression, TypeSyntax castTypeSyntax, TypeWithAnnotations castType, bool withDependencies) 879return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), ImmutableArray.Create(arg), diagnostics 892return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), args, diagnostics 899protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics 912protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
Binder\Binder_Statements.cs (13)
722TypeWithAnnotations declType = BindVariableTypeWithAnnotations(node.Declaration, diagnostics, typeSyntax, ref isConst, isVar: out isVar, alias: out alias); 787private TypeWithAnnotations BindVariableTypeWithAnnotations(CSharpSyntaxNode declarationNode, BindingDiagnosticBag diagnostics, TypeSyntax typeSyntax, ref bool isConst, out bool isVar, out AliasSymbol alias) 800TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax.SkipScoped(out _).SkipRef(), diagnostics, out isVar, out alias); 955TypeWithAnnotations declTypeOpt, 981TypeWithAnnotations declTypeOpt, 1026declTypeOpt = TypeWithAnnotations.Create(initializerType); 1031declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1046declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1374TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 1479return op1.SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(inferredType)); 2298var targetElementTypes = default(ImmutableArray<TypeWithAnnotations>); 2468ImmutableArray<TypeWithAnnotations> targetElementTypes) 2720TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias);
Binder\Binder_Symbols.cs (37)
37internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 57private TypeWithAnnotations BindTypeOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 78internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar, out AliasSymbol alias) 300internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null, bool suppressUseSiteDiagnostics = false) 309internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, out AliasSymbol alias, ConsList<TypeSymbol> basesBeingResolved = null) 339return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(GetContainingNamespaceOrType(symbol.Symbol), symbol.Symbol, LookupResultKind.NotATypeOrNamespace, diagnosticInfo)); 399/// stack frames due to their use of large struct like <see cref="TypeWithAnnotations"/>. 457return TypeWithAnnotations.Create( 473return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(tupleTypeSyntax.CloseParenToken), BindTupleType(tupleTypeSyntax, diagnostics, basesBeingResolved)); 519void reportNullableReferenceTypesIfNeeded(SyntaxToken questionToken, TypeWithAnnotations typeArgument = default) 541TypeWithAnnotations typeArgument = BindType(typeArgumentSyntax, diagnostics, basesBeingResolved); 542TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation); 569return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(predefinedType.Keyword), type); 582return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(left, LookupResultKind.NotATypeOrNamespace, diagnostics.Add(ErrorCode.ERR_ColColWithTypeAlias, node.Alias.Location, node.Alias.Identifier.Text))); 591var elementType = BindType(node.ElementType, diagnostics, basesBeingResolved); 599return TypeWithAnnotations.Create(new PointerTypeSymbol(elementType)); 605return TypeWithAnnotations.Create(CreateErrorType()); 609internal static CSDiagnosticInfo? GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(LanguageVersion languageVersion, in TypeWithAnnotations type) 625private TypeWithAnnotations BindArrayType( 632TypeWithAnnotations type = BindType(node.ElementType, diagnostics, basesBeingResolved); 668type = TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(rankSpecifier.CloseBracketToken), array); 679var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(numElements); 691var argumentType = BindType(argumentSyntax.Type, diagnostics, basesBeingResolved); 832return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null)); 858return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol( 866return TypeWithAnnotations.Create(errorResult); 1148private TypeWithAnnotations BindGenericSimpleNamespaceOrTypeOrAliasSymbol( 1254return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(node.TypeArgumentList.GreaterThanToken), resultType); 1335private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1338var args = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Count); 1347private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1360var arg = typeArgument.Kind() == SyntaxKind.OmittedTypeArgument 1361? TypeWithAnnotations.Create(UnboundArgumentErrorTypeSymbol.Instance) 1370private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1398ImmutableArray<TypeWithAnnotations> typeArguments, 1555ImmutableArray<TypeWithAnnotations> typeArguments, 1624TypeWithAnnotations type = right.TypeWithAnnotations;
Binder\Binder_TupleOperators.cs (1)
410elementTypesWithAnnotations: convertedTypes.SelectAsArray(t => TypeWithAnnotations.Create(t)),
Binder\BuckStopsHereBinder.cs (1)
152internal override TypeWithAnnotations GetIteratorElementType()
Binder\DecisionDagBuilder.cs (1)
553ImmutableArray<TypeWithAnnotations> elementTypes = inputType.TupleElementTypesWithAnnotations;
Binder\ExecutableCodeBinder.cs (1)
137TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, refKind, returnType, errorLocation, diagnostics);
Binder\ForEachEnumeratorInfo.cs (3)
19public readonly TypeWithAnnotations ElementTypeWithAnnotations; 48TypeWithAnnotations elementType, 85public TypeWithAnnotations ElementTypeWithAnnotations;
Binder\ForEachLoopBinder.cs (15)
179TypeWithAnnotations inferredType; 212TypeWithAnnotations inferredType; 250TypeWithAnnotations iterationVariableType; 284TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias); 288declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 348iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 606internal TypeWithAnnotations InferCollectionElementType(BindingDiagnosticBag diagnostics, ExpressionSyntax collectionSyntax) 612GetEnumeratorInfoAndInferCollectionElementType(ref builder, ref collectionExpr, diagnostics, out TypeWithAnnotations inferredType); 616private bool GetEnumeratorInfoAndInferCollectionElementType(ref ForEachEnumeratorInfo.Builder builder, ref BoundExpression collectionExpr, BindingDiagnosticBag diagnostics, out TypeWithAnnotations inferredType) 627inferredType = TypeWithAnnotations.Create(DynamicTypeSymbol.Instance); 635inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax)); 988builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax)); 1080builder.ElementTypeWithAnnotations = TypeWithAnnotations.Create( 1088TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, _syntax)) : 1217var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Binder\InContainerBinder.cs (2)
88internal override TypeWithAnnotations GetIteratorElementType() 94return TypeWithAnnotations.Create(this.Compilation.GetSpecialType(SpecialType.System_Object));
Binder\InMethodBinder.cs (5)
125internal override TypeWithAnnotations GetIteratorElementType() 138var elementType = GetIteratorElementTypeFromReturnType(Compilation, refKind, returnType, errorLocation: null, diagnostics: null); 139return !elementType.IsDefault ? elementType : TypeWithAnnotations.Create(CreateErrorType()); 145internal static TypeWithAnnotations GetIteratorElementTypeFromReturnType(CSharpCompilation compilation, 160return TypeWithAnnotations.Create(objectType);
Binder\Semantics\AccessCheck.cs (1)
235foreach (var typeArg in typeArgs)
Binder\Semantics\BestTypeInferrer.cs (3)
16public static NullableAnnotation GetNullableAnnotation(ArrayBuilder<TypeWithAnnotations> types) 19var example = types.FirstOrDefault(t => t.HasType); 23foreach (var type in types)
Binder\Semantics\Conversions\Conversions.cs (2)
320TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Object), customModifiers: parameter.TypeWithAnnotations.CustomModifiers), parameter.RefCustomModifiers, parameter.IsParams, parameter.RefKind); 392var sourceAsPointer = new PointerTypeSymbol(TypeWithAnnotations.Create(sourceExpression.ElementType));
Binder\Semantics\Conversions\ConversionsBase.cs (33)
1410if (anonymousFunction.HasExplicitReturnType(out var refKind, out var returnType)) 1686internal bool HasTopLevelNullabilityIdentityConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1718internal bool HasTopLevelNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1738private static bool IsPossiblyNullableTypeTypeParameter(in TypeWithAnnotations typeWithAnnotations) 1749public bool HasAnyNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1813(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 1830(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2132private delegate Conversion ClassifyConversionFromExpressionDelegate(ConversionsBase conversions, BoundExpression sourceExpression, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2133private delegate Conversion ClassifyConversionFromTypeDelegate(ConversionsBase conversions, TypeWithAnnotations source, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2147(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) 2165(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2218(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2237(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2258ImmutableArray<TypeWithAnnotations> sourceTypes; 2259ImmutableArray<TypeWithAnnotations> destTypes; 2443TypeWithAnnotations elementType = source.ElementTypeWithAnnotations; 2444TypeWithAnnotations argument0 = destinationAgg.TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo); 2454private bool HasImplicitReferenceConversion(TypeWithAnnotations source, TypeWithAnnotations destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2938var typeParameters = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2939var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2940var destinationTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2954var sourceTypeArgument = sourceTypeArguments[paramIndex]; 2955var destinationTypeArgument = destinationTypeArguments[paramIndex]; 3186bool hasConversion(RefKind refKind, TypeWithAnnotations sourceType, TypeWithAnnotations destinationType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
583var voidPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(Compilation.GetSpecialType(SpecialType.System_Void)));
Binder\Semantics\OverloadResolution\MethodGroup.cs (4)
20internal ArrayBuilder<TypeWithAnnotations> TypeArguments { get; } 28this.TypeArguments = new ArrayBuilder<TypeWithAnnotations>(); 44ImmutableArray<TypeWithAnnotations> typeArguments, 63ImmutableArray<TypeWithAnnotations> typeArguments,
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (167)
72public readonly ImmutableArray<TypeWithAnnotations> InferredTypeArguments; 81ImmutableArray<TypeWithAnnotations> inferredTypeArguments, 96internal abstract TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr); 98internal abstract TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method); 102internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 104return TypeWithAnnotations.Create(expr.GetTypeOrFunctionType()); 107internal override TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method) 135private readonly ImmutableArray<TypeWithAnnotations> _formalParameterTypes; 140private readonly (TypeWithAnnotations Type, bool FromFunctionType)[] _fixedResults; 141private readonly HashSet<TypeWithAnnotations>[] _exactBounds; 142private readonly HashSet<TypeWithAnnotations>[] _upperBounds; 143private readonly HashSet<TypeWithAnnotations>[] _lowerBounds; 173ImmutableArray<TypeWithAnnotations> formalParameterTypes, 318ImmutableArray<TypeWithAnnotations> formalParameterTypes, 331_fixedResults = new (TypeWithAnnotations, bool)[methodTypeParameters.Length]; 332_exactBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 333_upperBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 334_lowerBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 400var fixedType = _fixedResults[i].Type; 428private ImmutableArray<TypeWithAnnotations> GetResults(out bool inferredFromFunctionType) 448var fixedResultType = _fixedResults[i].Type; 466_fixedResults[i] = (TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(_constructedContainingTypeOfMethod, _methodTypeParameters[i].Name, 0, null, false)), false); 483private bool IsUnfixedTypeParameter(TypeWithAnnotations type) 508private void AddBound(TypeWithAnnotations addedBound, HashSet<TypeWithAnnotations>[] collectedBounds, TypeWithAnnotations methodTypeParameterWithAnnotations) 517collectedBounds[methodTypeParameterIndex] = new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer); 543static (typeParameter, i, self) => self.IsUnfixed(i) ? TypeWithAnnotations.Create(typeParameter) : self._fixedResults[i].Type, 585TypeWithAnnotations target = _formalParameterTypes[arg]; 592private void MakeExplicitParameterTypeInferences(BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 616var argumentType = _extensions.GetTypeWithAnnotations(argument); 629private bool MakeExplicitParameterTypeInferences(BoundTupleLiteral argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 661var destType = destTypes[i]; 779var formalType = _formalParameterTypes[arg]; 785private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 804private void MakeOutputTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 829var destType = destTypes[i]; 1250private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1275var sourceType = _extensions.GetTypeWithAnnotations(expression); 1283private bool InferredReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1301var returnType = delegateType.DelegateInvokeMethod.ReturnTypeWithAnnotations; 1307var inferredReturnType = InferReturnType(source, delegateType, ref useSiteInfo); 1356TypeWithAnnotations sourceReturnType = method.ReturnTypeWithAnnotations; 1375var returnType = MethodGroupReturnType(binder, originalMethodGroup, fixedParameters, method.RefKind, isFunctionPointerResolution, ref useSiteInfo, in callingConventionInfo); 1385private TypeWithAnnotations MethodGroupReturnType( 1402TypeWithAnnotations type = default; 1424private void ExplicitParameterTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1479private void ExplicitReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1496if (!anonymousFunction.HasExplicitReturnType(out _, out TypeWithAnnotations anonymousFunctionReturnType)) 1515private void ExactInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1562private bool ExactTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 1577private bool ExactArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1607private void ExactOrBoundsInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1623private bool ExactOrBoundsNullableInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1643static bool isNullableOnly(TypeWithAnnotations type) 1647private bool ExactNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1652private bool LowerBoundTupleInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1661ImmutableArray<TypeWithAnnotations> sourceTypes; 1662ImmutableArray<TypeWithAnnotations> targetTypes; 1679private bool ExactConstructedInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1709private bool ExactPointerInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1769var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1770var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1790private void LowerBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1877private bool LowerBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 1892private static TypeWithAnnotations GetMatchingElementType(ArrayTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1946var elementSource = arraySource.ElementTypeWithAnnotations; 1947var elementTarget = GetMatchingElementType(arraySource, target, ref useSiteInfo); 1965private bool LowerBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2167var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2168var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2180var sourceTypeArgument = sourceTypeArguments[arg]; 2181var targetTypeArgument = targetTypeArguments[arg]; 2254private void UpperBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2315private bool UpperBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 2329private bool UpperBoundArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2347var elementTarget = arrayTarget.ElementTypeWithAnnotations; 2348var elementSource = GetMatchingElementType(arrayTarget, source.Type, ref useSiteInfo); 2366private bool UpperBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2371private bool UpperBoundConstructedInference(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations targetWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2517var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2518var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2530var sourceTypeArgument = sourceTypeArguments[arg]; 2531var targetTypeArgument = targetTypeArguments[arg]; 2624var withoutNullability = Fix(_compilation, _conversions.WithNullability(false), typeParameter, exact, lower, upper, ref discardedUseSiteInfo).Type; 2636private static (TypeWithAnnotations Type, bool FromFunctionType) Fix( 2640HashSet<TypeWithAnnotations>? exact, 2641HashSet<TypeWithAnnotations>? lower, 2642HashSet<TypeWithAnnotations>? upper, 2657var candidates = new Dictionary<TypeWithAnnotations, TypeWithAnnotations>(EqualsIgnoringDynamicTupleNamesAndNullabilityComparer.Instance); 2704var initialCandidates = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2729TypeWithAnnotations best = default; 2730foreach (var candidate in initialCandidates) 2732foreach (var candidate2 in initialCandidates) 2770best = TypeWithAnnotations.Create(resultType, best.NullableAnnotation); 2776static bool containsFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 2781static bool containsNonFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 2786static bool isFunctionType(TypeWithAnnotations type, [NotNullWhen(true)] out FunctionTypeSymbol? functionType) 2811static HashSet<TypeWithAnnotations>? removeTypes(HashSet<TypeWithAnnotations>? types, Func<TypeWithAnnotations, bool> predicate) 2817HashSet<TypeWithAnnotations>? updated = null; 2818foreach (var type in types) 2822updated ??= new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer); 2830private static bool ImplicitConversionExists(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations destinationWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConversionsBase conversions) 2854private TypeWithAnnotations InferReturnType(BoundExpression source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2935var returnType = anonymousFunction.InferReturnType(_conversions, fixedDelegate, ref useSiteInfo, out bool inferredFromFunctionType); 2994public static ImmutableArray<TypeWithAnnotations> InferTypeArgumentsFromFirstArgument( 3008return default(ImmutableArray<TypeWithAnnotations>); 3027return default(ImmutableArray<TypeWithAnnotations>); 3041var dest = _formalParameterTypes[0]; 3073private ImmutableArray<TypeWithAnnotations> GetInferredTypeArguments(out bool inferredFromFunctionType) 3075var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_fixedResults.Length); 3095private static void GetAllCandidates(Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, ArrayBuilder<TypeWithAnnotations> builder) 3101Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3102HashSet<TypeWithAnnotations> bounds, 3106foreach (var candidate in bounds) 3108var type = candidate; 3124Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3125TypeWithAnnotations newCandidate, 3128if (candidates.TryGetValue(newCandidate, out TypeWithAnnotations oldCandidate)) 3139Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3140HashSet<TypeWithAnnotations> bounds, 3141ArrayBuilder<TypeWithAnnotations> initialCandidates, 3150foreach (var bound in bounds) 3152foreach (var candidate in initialCandidates) 3158TypeWithAnnotations source; 3159TypeWithAnnotations destination; 3173if (conversions.IncludeNullability && candidates.TryGetValue(bound, out var oldBound)) 3180var newBound = TypeWithAnnotations.Create(oldBound.Type, newAnnotation); 3200Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3201TypeWithAnnotations oldCandidate, 3202TypeWithAnnotations newCandidate, 3211if (candidates.TryGetValue(oldCandidate, out TypeWithAnnotations latest)) 3222TypeWithAnnotations merged = latest.MergeEquivalentTypes(newCandidate, variance); 3231private sealed class EqualsIgnoringDynamicTupleNamesAndNullabilityComparer : EqualityComparer<TypeWithAnnotations> 3235public override int GetHashCode(TypeWithAnnotations obj) 3240public override bool Equals(TypeWithAnnotations x, TypeWithAnnotations y)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (22)
119ArrayBuilder<TypeWithAnnotations> typeArguments, 149ArrayBuilder<TypeWithAnnotations> typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 159ArrayBuilder<TypeWithAnnotations> typeArguments, 231ArrayBuilder<TypeWithAnnotations> typeArguments, 340var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 819ArrayBuilder<TypeWithAnnotations> typeArguments, 2548var x = lambda.GetInferredReturnType(ref useSiteInfo, out _); 2973var x = lambda.InferReturnType(Conversions, d1, ref useSiteInfo, out _); 3082out ImmutableArray<TypeWithAnnotations> parameterTypes, 3095internal readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 3098internal EffectiveParameters(ImmutableArray<TypeWithAnnotations> types, ImmutableArray<RefKind> refKinds) 3145var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3234var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3245var type = parameter.TypeWithAnnotations; 3267ArrayBuilder<TypeWithAnnotations> typeArguments, 3351ArrayBuilder<TypeWithAnnotations> typeArguments, 3417ArrayBuilder<TypeWithAnnotations> typeArgumentsBuilder, 3452ImmutableArray<TypeWithAnnotations> typeArguments; 3548private ImmutableArray<TypeWithAnnotations> InferMethodTypeArguments( 3593return default(ImmutableArray<TypeWithAnnotations>); 3599return default(ImmutableArray<TypeWithAnnotations>);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1268TypeWithAnnotations.Create(argType),
Binder\WithLambdaParametersBinder.cs (2)
73internal override TypeWithAnnotations GetIteratorElementType() 75return TypeWithAnnotations.Create(CreateErrorType());
BoundTree\BoundDiscardExpression.cs (2)
12public BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type) 33return new DiscardSymbol(TypeWithAnnotations.Create(this.Type, this.TopLevelNullability.Annotation.ToInternalAnnotation()));
BoundTree\BoundMethodGroup.cs (1)
15ImmutableArray<TypeWithAnnotations> typeArgumentsOpt,
BoundTree\Constructors.cs (5)
486public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 492public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 497public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 503: this(syntax, aliasOpt, null, TypeWithAnnotations.Create(type), hasErrors) 507public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, ImmutableArray<BoundExpression> dimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false)
BoundTree\ConversionGroup.cs (2)
18internal ConversionGroup(Conversion conversion, TypeWithAnnotations explicitType = default) 39internal readonly TypeWithAnnotations ExplicitType;
BoundTree\OutDeconstructVarPendingInference.cs (2)
14public BoundDeconstructValuePlaceholder SetInferredTypeWithAnnotations(TypeWithAnnotations type, bool success) 24return SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(binder.CreateErrorType()), success: false);
BoundTree\UnboundLambda.cs (68)
44internal readonly TypeWithAnnotations TypeWithAnnotations; 54TypeWithAnnotations typeWithAnnotations, 106public TypeWithAnnotations GetInferredReturnType(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 117public TypeWithAnnotations GetInferredReturnType(ConversionsBase? conversions, NullableWalker.VariableState? nullableState, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 144var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 169TypeWithAnnotations returnType, 170ImmutableArray<TypeWithAnnotations> parameterTypes, 185internal static InferredLambdaReturnType InferReturnType(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 192internal static InferredLambdaReturnType InferReturnType(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 202private static InferredLambdaReturnType InferReturnTypeImpl(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 205var types = ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)>.GetInstance(); 227var bestType = CalculateReturnType(binder, conversions, delegateType, types, isAsync, node, ref useSiteInfo, out bool inferredFromFunctionType); 242private static TypeWithAnnotations CalculateReturnType( 246ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns, 252TypeWithAnnotations bestResultType; 278bestResultType = TypeWithAnnotations.Create(bestType); 290bestResultType = TypeWithAnnotations.Create(bestType); 320return TypeWithAnnotations.Create(resultType); 335return TypeWithAnnotations.Create(taskTypeT.Construct(ImmutableArray.Create(bestResultType))); 340private readonly ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> _builder; 342private BlockReturns(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder) 347public static void GetReturnTypes(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder, BoundBlock block) 380_builder.Add((node, TypeWithAnnotations.Create(type))); 395TypeWithAnnotations returnType, 399ImmutableArray<TypeWithAnnotations> types, 463public bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType) 469public TypeWithAnnotations InferReturnType(ConversionsBase conversions, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 480public TypeWithAnnotations ParameterTypeWithAnnotations(int index) { return Data.ParameterTypeWithAnnotations(index); } 547public abstract bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType); 554public abstract TypeWithAnnotations ParameterTypeWithAnnotations(int index); 595var type = lambda.InferredReturnType.TypeWithAnnotations; 605var type = BindForErrorRecovery().InferredReturnType.TypeWithAnnotations; 618private static TypeWithAnnotations DelegateReturnTypeWithAnnotations(MethodSymbol? invokeMethod, out RefKind refKind) 629internal (ImmutableArray<RefKind>, ArrayBuilder<ScopedKind>, ImmutableArray<TypeWithAnnotations>, bool) CollectParameterProperties() 633var parameterTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(ParameterCount); 640var type = ParameterTypeWithAnnotations(i); 679if (!HasExplicitReturnType(out var returnRefKind, out var returnType)) 683var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 723returnType = TypeWithAnnotations.Create(Binder.Compilation.GetSpecialType(SpecialType.System_Void)); 740var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind); 843TypeWithAnnotations returnType, 844ImmutableArray<TypeWithAnnotations> parameterTypes, 860var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind); 865private void ValidateUnsafeParameters(BindingDiagnosticBag diagnostics, ImmutableArray<TypeWithAnnotations> targetParameterTypes) 892ImmutableArray<TypeWithAnnotations> parameterTypes, 895bool hasExplicitReturnType = HasExplicitReturnType(out var refKind, out var returnType); 914var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 924? TypeWithAnnotations.Create(this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)) 925: TypeWithAnnotations.Create(LambdaSymbol.InferenceFailureReturnType); 949ImmutableArray<TypeWithAnnotations> parameterTypes, 951TypeWithAnnotations returnType, 985public readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 989public static readonly ReturnInferenceCacheKey Empty = new ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty, null); 991private ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations> parameterTypes, ImmutableArray<RefKind> parameterRefKinds, NamedTypeSymbol? taskLikeReturnTypeOpt) 1031foreach (var type in ParameterTypes) 1051out ImmutableArray<TypeWithAnnotations> parameterTypes, 1057parameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 1066var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(parameterCount); 1143?? rebind(ReallyInferReturnType(delegateType: null, ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty)); 1159ImmutableArray<TypeWithAnnotations> parameterTypes, 1162var returnType = inferredReturnType.TypeWithAnnotations; 1174returnType = TypeWithAnnotations.Create(t); 1389private readonly TypeWithAnnotations _returnType; 1393private readonly ImmutableArray<TypeWithAnnotations> _parameterTypesWithAnnotations; 1405TypeWithAnnotations returnType, 1409ImmutableArray<TypeWithAnnotations> parameterTypesWithAnnotations, 1437public override bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType) 1517public override TypeWithAnnotations ParameterTypeWithAnnotations(int index)
BoundTree\VariablePendingInference.cs (3)
27internal BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type, BindingDiagnosticBag? diagnosticsOpt) 34internal BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type, Binder? binderOpt, BindingDiagnosticBag? diagnosticsOpt) 45type = TypeWithAnnotations.Create(binderOpt!.CreateErrorType("var"));
CodeGen\EmitArrayInitializer.cs (1)
663arrayType = arrayType.WithElementType(TypeWithAnnotations.Create(elementType.EnumUnderlyingTypeOrSelf()));
CodeGen\Optimizer.cs (1)
2268public override TypeWithAnnotations TypeWithAnnotations
Compilation\CSharpCompilation.cs (10)
2068var firstType = method.Parameters[0].TypeWithAnnotations; 2202return ArrayTypeSymbol.CreateCSharpArray(this.Assembly, TypeWithAnnotations.Create(elementType, elementNullableAnnotation), rank); 2215return new PointerTypeSymbol(TypeWithAnnotations.Create(elementType, elementNullableAnnotation)); 3778var returnTypeWithAnnotations = TypeWithAnnotations.Create(returnType.EnsureCSharpSymbolOrNull(nameof(returnType)), returnType.NullableAnnotation.ToInternalAnnotation()); 3780type => TypeWithAnnotations.Create(type.EnsureCSharpSymbolOrNull(nameof(parameterTypes)), type.NullableAnnotation.ToInternalAnnotation())); 3828var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(elementTypes.Length); 3834typesBuilder.Add(TypeWithAnnotations.Create(elementType, annotation)); 3872(t, a) => TypeWithAnnotations.Create(t.Type, a.ToInternalAnnotation()))); 3902fields.Add(new AnonymousTypeField(name, location, TypeWithAnnotations.Create(type, nullableAnnotation), RefKind.None, ScopedKind.None));
Compilation\CSharpSemanticModel.cs (3)
4644ImmutableArray<TypeWithAnnotations> typeArguments, 4683ImmutableArray<TypeWithAnnotations> typeArguments, 4748AddReducedAndFilteredMethodGroupSymbol(methodBuilder, filteredMethodBuilder, method, default(ImmutableArray<TypeWithAnnotations>), extensionThisType, compilation);
Compiler\ClsComplianceChecker.cs (6)
276foreach (var paramType in constructor.ParameterTypesWithAnnotations) // Public caller would select type out of parameters. 552foreach (TypeWithAnnotations constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 630foreach (var type in attribute.AttributeConstructor.ParameterTypesWithAnnotations) 1037foreach (TypeWithAnnotations typeArg in type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1318ImmutableArray<TypeWithAnnotations> xParameterTypes; 1319ImmutableArray<TypeWithAnnotations> yParameterTypes;
Compiler\MethodBodySynthesizer.cs (1)
430tmps[i] = new SynthesizedLocal(accessor, TypeWithAnnotations.Create(delegateType), SynthesizedLocalKind.LoweringTemp);
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
201foreach (var typeArgument in symbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (12)
610var otherReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(otherReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 612var otherParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 617var otherParamsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount); 733bool isCorrespondingType(TypeWithAnnotations type, TypeWithAnnotations expectedType) 735var otherType = type.WithTypeAndModifiers((TypeSymbol?)this.Visit(type.Type), this.VisitCustomModifiers(type.CustomModifiers)); 898private static void ValidateFunctionPointerParamOrReturn(TypeWithAnnotations type, RefKind refKind, ImmutableArray<CustomModifier> refCustomModifiers, bool allowOut) 940private bool AreTypesEqual(TypeWithAnnotations type, TypeWithAnnotations other) 1113var translatedReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(translatedReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 1116var translatedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 1121var translatedParamsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount);
Emitter\Model\ArrayTypeSymbolAdapter.cs (1)
26TypeWithAnnotations elementType = AdaptedArrayTypeSymbol.ElementTypeWithAnnotations;
Emitter\Model\FieldSymbolAdapter.cs (1)
32TypeWithAnnotations fieldTypeWithAnnotations = AdaptedFieldSymbol.TypeWithAnnotations;
Emitter\Model\GenericMethodInstanceReference.cs (1)
34foreach (var arg in UnderlyingMethod.TypeArgumentsWithAnnotations)
Emitter\Model\GenericTypeInstanceReference.cs (1)
42foreach (TypeWithAnnotations type in UnderlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Emitter\Model\MethodSymbolAdapter.cs (1)
258foreach (var arg in AdaptedMethodSymbol.TypeArgumentsWithAnnotations)
Emitter\Model\MostCommonNullableValueBuilder.cs (1)
69internal void AddValue(TypeWithAnnotations type)
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
483var type = TypeWithAnnotations.Create(@interface);
Emitter\Model\PEModuleBuilder.cs (3)
1587internal SynthesizedAttributeData SynthesizeNullableAttributeIfNecessary(Symbol symbol, byte? nullableContextValue, TypeWithAnnotations type) 1614var byteArrayType = ArrayTypeSymbol.CreateSZArray(byteType.ContainingAssembly, TypeWithAnnotations.Create(byteType)); 1700var boolArray = ArrayTypeSymbol.CreateSZArray(booleanType.ContainingAssembly, TypeWithAnnotations.Create(booleanType));
Emitter\Model\SpecializedFieldReference.cs (1)
63TypeWithAnnotations oldType = _underlyingField.TypeWithAnnotations;
Emitter\Model\SpecializedGenericMethodInstanceReference.cs (1)
35foreach (var arg in UnderlyingMethod.TypeArgumentsWithAnnotations)
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (1)
41foreach (TypeWithAnnotations type in UnderlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Emitter\Model\TypeParameterSymbolAdapter.cs (1)
254foreach (var type in AdaptedTypeParameterSymbol.ConstraintTypesNoUseSiteDiagnostics)
Emitter\NoPia\EmbeddedType.cs (2)
137var type = TypeWithAnnotations.Create(@interface);
Errors\LazyArrayElementCantBeRefAnyDiagnosticInfo.cs (2)
15private readonly TypeWithAnnotations _possiblyRestrictedTypeSymbol; 17internal LazyArrayElementCantBeRefAnyDiagnosticInfo(TypeWithAnnotations possiblyRestrictedTypeSymbol)
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (3)
19private readonly TypeWithAnnotations _type; 22private LazyMissingNonNullTypesContextDiagnosticInfo(TypeWithAnnotations type, DiagnosticInfo info) 46public static void AddAll(Binder binder, SyntaxToken questionToken, TypeWithAnnotations? type, DiagnosticBag diagnostics)
Errors\LazyObsoleteDiagnosticInfo.cs (2)
20Debug.Assert(symbol is Symbol || symbol is TypeWithAnnotations); 42var symbol = (_symbolOrSymbolWithAnnotations as Symbol) ?? ((TypeWithAnnotations)_symbolOrSymbolWithAnnotations).Type;
Errors\LazyUseSiteDiagnosticsInfoForNullableType.cs (2)
12private readonly TypeWithAnnotations _possiblyNullableTypeSymbol; 14internal LazyUseSiteDiagnosticsInfoForNullableType(LanguageVersion languageVersion, TypeWithAnnotations possiblyNullableTypeSymbol)
FlowAnalysis\NullableWalker.cs (196)
100public readonly TypeWithAnnotations LValueType; 102public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType) 114LValueType = TypeWithAnnotations.Create(type, annotation); 133public TypeWithAnnotations LValueType => VisitResult.LValueType; 181private ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? _returnTypesOpt; 219private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt; 224/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 226private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion 227=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 291private TypeWithAnnotations LvalueResultType 296private void SetLvalueResultType(BoundExpression? expression, TypeWithAnnotations type) 311private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null) 320private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null) 426ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 688TypeWithAnnotations symbolType; 906var type = memberToInitialize.GetTypeOrReturnType(); 1638ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt) 1684ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 1865if (!_variables.TryGetType(local, out TypeWithAnnotations localType)) 1874if (!_variables.TryGetType(parameter, out TypeWithAnnotations parameterType)) 2149private TypeWithAnnotations VisitLvalueWithAnnotations(BoundExpression node) 2190private static bool ShouldReportNullableAssignment(TypeWithAnnotations type, NullableFlowState state) 2226TypeWithAnnotations targetType, 2304TypeWithAnnotations overriddenType, 2306TypeWithAnnotations overridingType, 2377static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2453TypeWithAnnotations targetType, 2496static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2563TypeWithAnnotations fieldOrPropertyType = member.GetTypeOrReturnType(); 2734var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations; 2740private void EnterParameter(ParameterSymbol parameter, TypeWithAnnotations parameterType) 2769var parameterLValueType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 2785internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 2815TryGetReturnType(out TypeWithAnnotations returnType, out FlowAnalysisAnnotations returnAnnotations)) 2873private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 2879var lvalueResultType = LvalueResultType; 2895private bool TryGetReturnType(out TypeWithAnnotations type, out FlowAnalysisAnnotations annotations) 2906var returnType = delegateOrMethod.ReturnTypeWithAnnotations; 2950var type = GetDeclaredLocalResult(local); 2958type = TypeWithAnnotations.Create(node.Type, type.NullableAnnotation); 3192var resultType = ResultType.ToTypeWithAnnotations(compilation); 3293TypeWithAnnotations type = local.TypeWithAnnotations; 3521(TypeWithAnnotations resultTypeWithAnnotations) => 3601var parameterType = constructor.ParameterTypesWithAnnotations[0]; 3602if (AreNullableAndUnderlyingTypes(type, parameterType.Type, out TypeWithAnnotations underlyingType)) 3850Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 3861var type = ApplyLValueAnnotations(symbol.GetTypeOrReturnType(), GetObjectInitializerMemberLValueAnnotations(symbol)); 3883Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4061return GetOrCreatePlaceholderSlot(node, TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated)); 4064private int GetOrCreatePlaceholderSlot(object identifier, TypeWithAnnotations type) 4166var elementType = type switch 4214TypeWithAnnotations inferredType = (bestType is null) 4216: TypeWithAnnotations.Create(bestType); 4266static TypeWithAnnotations getSpanElementType(NamedTypeSymbol namedType) 4273static TypeSymbol setSpanElementType(NamedTypeSymbol namedType, TypeWithAnnotations elementType) 4294internal static TypeWithAnnotations BestTypeForLambdaReturns( 4295ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns, 4317var resultTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(n); 4330TypeWithAnnotations inferredType; 4334var bestTypeWithObliviousAnnotation = TypeWithAnnotations.Create(bestType); 4346inferredType = TypeWithAnnotations.Create(bestType, BestTypeInferrer.GetNullableAnnotation(resultTypes)); 4393TypeWithAnnotations result; 4397result = TypeWithAnnotations.Create(type); 4626SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 4672var targetTypeWithNullability = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 4676targetTypeWithNullability = TypeWithAnnotations.Create(MakeNullableOf(targetTypeWithNullability)); 4717TypeWithAnnotations.Create(expr.Type), 5104TypeWithAnnotations targetType = VisitLvalueWithAnnotations(leftOperand); 5110targetType = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 5198TypeWithAnnotations.Create(rightType), 5234TypeWithAnnotations explicitType = boundConversion.ConversionGroupOpt?.ExplicitType ?? default; 5236TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(boundConversion.Type); 5374var accessTypeWithAnnotations = LvalueResultType; 5425TypeWithAnnotations consequenceLValue; 5426TypeWithAnnotations alternativeLValue; 5447SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 5488TypeWithAnnotations resultTypeWithAnnotations; 5507resultTypeWithAnnotations = TypeWithAnnotations.Create(resultType); 5520BoundExpression alternative, Conversion alternativeConversion, bool alternativeEndReachable, TypeWithAnnotations resultTypeWithAnnotations, bool wasTargetTyped) 5577(TypeWithAnnotations resultTypeWithAnnotations) => 5599(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 5603TypeWithAnnotations lValueType = VisitLvalueWithAnnotations(operand); 5612TypeWithAnnotations targetType, 5660private static BoundExpression CreatePlaceholderIfNecessary(BoundExpression expr, TypeWithAnnotations type) 5775var parameterType = method.Parameters[0].TypeWithAnnotations; 6020private static TypeWithAnnotations ApplyLValueAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations flowAnalysisAnnotations) 6052private static TypeWithAnnotations ApplyUnconditionalAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations annotations) 6239(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, bool isExpandedParamsArgument) = 6297(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, _) = 6554TypeWithAnnotations parameterType, 6609var lvalueResultType = result.LValueType; 6691TypeWithAnnotations parameterType, 6721var lValueType = result.LValueType; 6745var declaredType = result.LValueType; 6747var lValueType = ApplyLValueAnnotations(declaredType, leftAnnotations); 6750var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 6804void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 6986private (ParameterSymbol? Parameter, TypeWithAnnotations Type, FlowAnalysisAnnotations Annotations, bool isExpandedParamsArgument) GetCorrespondingParameter( 7004var type = parameter.TypeWithAnnotations; 7046parameterTypes: out ImmutableArray<TypeWithAnnotations> parameterTypes, 7079internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 7081return TypeWithAnnotations.Create(expr.GetTypeOrFunctionType(), GetNullableAnnotation(expr)); 7111internal override TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method) 7138var argumentResult = visitArgumentResult.RValueType.ToTypeWithAnnotations(compilation); 7143BoundExpression getArgumentForMethodTypeInference(BoundExpression argument, TypeWithAnnotations argumentType, Optional<LocalState> lambdaState) 7427TypeWithAnnotations explicitType = node.ConversionGroupOpt?.ExplicitType ?? default; 7429TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(node.Type); 7459private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 7471private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 7473TypeWithAnnotations targetTypeOpt, 7485(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 7487TypeWithAnnotations targetTypeOpt, 7522Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 7524return (TypeWithAnnotations targetTypeOpt) => 7533private static bool AreNullableAndUnderlyingTypes([NotNullWhen(true)] TypeSymbol? nullableTypeOpt, [NotNullWhen(true)] TypeSymbol? underlyingTypeOpt, out TypeWithAnnotations underlyingTypeWithAnnotations) 7538var typeArg = nullableTypeOpt.GetNullableUnderlyingTypeWithAnnotations(); 7573ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 7911TypeWithAnnotations targetTypeWithNullability, 7931if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 8123if (AreNullableAndUnderlyingTypes(targetType, operandType.Type, out TypeWithAnnotations underlyingType)) 8237static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 8253static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 8287static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 8347foreach (var constraintType in typeParameter1.ConstraintTypesNoUseSiteDiagnostics) 8437TypeWithAnnotations targetTypeWithNullability, 8468TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.FromType), 8488var parameterType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 8494var underlyingOperandTypeWithAnnotations = operandType.Type.GetNullableUnderlyingTypeWithAnnotations(); 8520var methodReturnType = method.ReturnTypeWithAnnotations; 8539TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.ToType), 8611TypeWithAnnotations.Create(newType, visitResult.LValueType.NullableAnnotation)); 8617private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 8638private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 8645private TypeSymbol MakeNullableOf(TypeWithAnnotations underlying) 8652TypeWithAnnotations targetType, 8752(TypeWithAnnotations resultTypeWithAnnotations) => 8833var argTypeWithAnnotations = TypeWithAnnotations.Create(argType, NullableAnnotation.NotAnnotated); 8930var parameterType = parameter.TypeWithAnnotations; 9020var lvalueResult = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 9028var parameterType = GetDeclaredParameterResult(parameter); 9057TypeWithAnnotations declaredType = LvalueResultType; 9058TypeWithAnnotations leftLValueType = ApplyLValueAnnotations(declaredType, leftAnnotations); 9090var lvalueType = rightState.ToTypeWithAnnotations(compilation); 9105var type = property.TypeWithAnnotations; 9107var lValueType = ApplyLValueAnnotations(type, annotations); 9378var lvalueType = variable.Type; 9430AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType)) 9446internal readonly TypeWithAnnotations Type; 9449internal DeconstructionVariable(BoundExpression expression, TypeWithAnnotations type) 9533var operandLvalue = LvalueResultType; 9540TypeWithAnnotations targetTypeOfOperandConversion; 9596var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 9633TypeWithAnnotations declaredType = LvalueResultType; 9634TypeWithAnnotations leftLValueType = declaredType; 9649TypeWithAnnotations.Create(node.Operator.LeftType), 9731var paramType = parameter.TypeWithAnnotations; 9766private TypeWithAnnotations GetDeclaredLocalResult(LocalSymbol local) 9768return _variables.TryGetType(local, out TypeWithAnnotations type) ? 9773private TypeWithAnnotations GetDeclaredParameterResult(ParameterSymbol parameter) 9775return _variables.TryGetType(parameter, out TypeWithAnnotations type) ? 9891var type = member.GetTypeOrReturnType(); 9994TypeWithAnnotations targetTypeWithAnnotations; 10030targetTypeWithAnnotations = TypeWithAnnotations.Create(node.Expression.Type); 10037targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple)); 10088TypeWithAnnotations.Create(node.EnumeratorInfoOpt.ElementType, NullableAnnotation.NotAnnotated).ToTypeWithState(); 10152TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 10181TypeWithAnnotations destinationType = iterationVariable.TypeWithAnnotations; 10277var type = TypeWithAnnotations.Create(node.Type); 10378var type = TypeWithAnnotations.Create(node.Type); 10386var type = TypeWithAnnotations.Create(node.Type); 10408var type = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 10738var result = TypeWithAnnotations.Create(node.Type); 10758var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 10864var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 10933private static bool IsNullabilityMismatch(TypeWithAnnotations type1, TypeWithAnnotations type2) 11035var result = TypeWithAnnotations.Create(node.Type, node.IsInferred ? NullableAnnotation.Annotated : node.NullableAnnotation); 11079TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None, 11132var typeWithAnnotations = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 11197var returnTypeWithAnnotations = node.FunctionPointer.Signature.ReturnTypeWithAnnotations;
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (3)
25private readonly TypeWithAnnotations _type; 28public PlaceholderLocal(Symbol containingSymbol, object identifier, TypeWithAnnotations type) 52public override TypeWithAnnotations TypeWithAnnotations => _type;
FlowAnalysis\NullableWalker.SnapshotManager.cs (2)
63internal TypeWithAnnotations? GetUpdatedTypeForLocalSymbol(SourceLocalSymbol symbol) 67if (sharedState.Variables.TryGetType(symbol, out var updatedType))
FlowAnalysis\NullableWalker.Variables.cs (7)
48internal readonly ImmutableDictionary<Symbol, TypeWithAnnotations> VariableTypes; 50internal VariablesSnapshot(int id, VariablesSnapshot? container, Symbol? symbol, ImmutableArray<KeyValuePair<VariableIdentifier, int>> variableSlot, ImmutableDictionary<Symbol, TypeWithAnnotations> variableTypes) 59internal bool TryGetType(Symbol symbol, out TypeWithAnnotations type) 128private readonly PooledDictionary<Symbol, TypeWithAnnotations> _variableTypes = SpecializedSymbolCollections.GetPooledSymbolDictionaryInstance<Symbol, TypeWithAnnotations>(); 297internal bool TryGetType(Symbol symbol, out TypeWithAnnotations type) 303internal void SetType(Symbol symbol, TypeWithAnnotations type)
FlowAnalysis\NullableWalker_Patterns.cs (19)
349var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 413var parameterType = method.Parameters[i + extensionExtra].TypeWithAnnotations; 438outputSlot = makeDagTempSlot(TypeWithAnnotations.Create(e.Type, NullableAnnotation.NotAnnotated), output); 451var type = field.TypeWithAnnotations; 495var type = property.TypeWithAnnotations; 520TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: false); 532TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: true); 644var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 645if (_variables.TryGetType(local, out var existingType)) 648inferredType = TypeWithAnnotations.Create(inferredType.Type, existingType.NullableAnnotation.Join(inferredType.NullableAnnotation)); 791int makeDagTempSlot(TypeWithAnnotations type, BoundDagTemp temp) 799var type = TypeWithAnnotations.Create(t, NullableAnnotation.Annotated); 806static TypeWithAnnotations getIndexerOutputType(TypeSymbol inputType, BoundExpression e, bool isSlice) 814? TypeWithAnnotations.Create(isNullableEnabled: true, inputType, isAnnotated: false) 912var inferredTypeWithAnnotations = TypeWithAnnotations.Create(inferredType); 946TypeWithAnnotations inferredTypeWithAnnotations, 993(TypeWithAnnotations inferredTypeWithAnnotations) =>
Generated\BoundNodes.xml.Generated.cs (9)
1056public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1072public TypeWithAnnotations TypeWithAnnotations { get; } 1077public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 5726public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false) 5743public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 5751public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type) 5963public BoundMethodGroup(SyntaxNode syntax, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 5979public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 5990public BoundMethodGroup Update(ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (5)
175var pendingExceptionLocal = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax); 177var pendingBranchVar = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(_F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax); 975this.returnValue = returnValue = new SynthesizedLocal(containingMethod, TypeWithAnnotations.Create(valueOpt.Type), SynthesizedLocalKind.AsyncMethodReturnValue, _syntaxOpt); 1009this.pendingCaughtException = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Object)), SynthesizedLocalKind.TryAwaitPendingCaughtException, tryStatementSyntax); 1010this.pendingCatch = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingCatch, tryStatementSyntax);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
427typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty,
Lowering\ClosureConversion\ClosureConversion.cs (11)
651var frameTypeParameters = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, frame.Arity); 655LocalSymbol framePointer = new SynthesizedLocal(_topLevelMethod, TypeWithAnnotations.Create(frameType), SynthesizedLocalKind.LambdaDisplayClass, frame.ScopeSyntaxOpt); 945private ImmutableArray<TypeWithAnnotations> SubstituteTypeArguments(ImmutableArray<TypeWithAnnotations> typeArguments) 969var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Length); 970foreach (var typeArg in typeArguments) 972TypeWithAnnotations oldTypeArg; 973TypeWithAnnotations newTypeArg = typeArg; 998ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 1010var realTypeArguments = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, totalTypeArgumentCount - originalMethod.Arity); 1623RemapLambdaOrLocalFunction(node.Syntax, node.Symbol, default(ImmutableArray<TypeWithAnnotations>), closureKind, ref referencedMethod, out receiver, out constructedFrame);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (4)
20private readonly TypeWithAnnotations _type; 23private LambdaCapturedVariable(SynthesizedContainer frame, TypeWithAnnotations type, string fieldName, bool isThisParameter) 44return new LambdaCapturedVariable(frame, TypeWithAnnotations.Create(type), fieldName, IsThis(captured)); 123internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
117_payloadType = ArrayTypeSymbol.CreateCSharpArray(methodBodyFactory.Compilation.Assembly, TypeWithAnnotations.Create(payloadElementType)); 253ArrayTypeSymbol.CreateCSharpArray(_methodBodyFactory.Compilation.Assembly, TypeWithAnnotations.Create(_payloadType));
Lowering\IteratorRewriter\IteratorConstructor.cs (1)
28SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 0, RefKind.None, GeneratedNames.MakeStateMachineStateFieldName()));
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (4)
145public override TypeWithAnnotations ReturnTypeWithAnnotations 147get { return TypeWithAnnotations.Create(ContainingAssembly.GetSpecialType(SpecialType.System_Void)); } 154public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 156get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Lowering\IteratorRewriter\IteratorRewriter.cs (2)
21private readonly TypeWithAnnotations _elementType; 59TypeWithAnnotations elementType = method.IteratorElementTypeWithAnnotations;
Lowering\IteratorRewriter\IteratorStateMachine.cs (2)
24internal readonly TypeWithAnnotations ElementType; 26public IteratorStateMachine(VariableSlotAllocator slotAllocatorOpt, TypeCompilationState compilationState, MethodSymbol iteratorMethod, int iteratorMethodOrdinal, bool isEnumerable, TypeWithAnnotations elementType)
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
214foreach (var typeArgument in method.TypeArgumentsWithAnnotations)
Lowering\LocalRewriter\LocalRewriter.cs (2)
353static bool hasReturnTypeOrParameter(LocalFunctionSymbol localFunction, Func<TypeWithAnnotations, bool> predicate) => 721var elementType = ((ArrayTypeSymbol)node.Expression.Type).ElementTypeWithAnnotations;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
374var operandType = new PointerTypeSymbol(TypeWithAnnotations.Create(_factory.SpecialType(SpecialType.System_Void)));
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
32ImmutableArray<TypeWithAnnotations> typeArguments;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
97var byteArray = ArrayTypeSymbol.CreateSZArray(_compilation.Assembly, TypeWithAnnotations.Create(byteType));
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (2)
264var tupleType = NamedTypeSymbol.CreateTuple(locationOpt: null, elementTypesWithAnnotations: builder!.SelectAsArray(e => TypeWithAnnotations.Create(e.Type)), 390var localSymbol = new SynthesizedLocal(_factory.CurrentFunction, TypeWithAnnotations.Create(outputPlaceholder.Type), SynthesizedLocalKind.LoweringTemp);
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
484TypeWithAnnotations arrayElementType = arrayType.ElementTypeWithAnnotations;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
130ImmutableArray<TypeWithAnnotations>.Empty,
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
472BoundExpression MakeBoundConversion(BoundExpression expr, Conversion conversion, TypeWithAnnotations type, BoundConversion enclosing)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
196ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations,
Lowering\MethodToClassRewriter.cs (3)
112newLocal = new TypeSubstitutedLocalSymbol(local, TypeWithAnnotations.Create(newType), CurrentMethod); 331var visitedTypeArgs = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArgs.Length); 332foreach (var typeArg in typeArgs)
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (5)
21private readonly TypeWithAnnotations _type; 30public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, bool isPublic, bool isThis) 42this(stateMachineType, TypeWithAnnotations.Create(type), name, slotDebugInfo, slotIndex, isPublic) 46public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic) 66internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
46public override TypeWithAnnotations TypeWithAnnotations
Lowering\SynthesizedMethodBaseSymbol.cs (3)
92public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 93=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 204public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Lowering\SyntheticBoundNodeFactory.cs (12)
118typeArgs: typeArgs.IsDefault ? default(ImmutableArray<TypeWithAnnotations>) : typeArgs.SelectAsArray(t => TypeWithAnnotations.Create(t)), 217public StateMachineFieldSymbol StateMachineField(TypeWithAnnotations type, string name, bool isPublic = false, bool isThis = false) 228var result = new StateMachineFieldSymbol(CurrentType, TypeWithAnnotations.Create(type), name, isPublic, isThis); 563return new SynthesizedLocal(CurrentFunction, TypeWithAnnotations.Create(type), kind, syntax, isPinned, 583TypeWithAnnotations.Create(type), 594return SynthesizedParameterSymbol.Create(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, name); 1160public BoundExpression NullRef(TypeWithAnnotations type) 1195public BoundExpression Typeof(TypeWithAnnotations type) 1200public ImmutableArray<BoundExpression> TypeOfs(ImmutableArray<TypeWithAnnotations> typeArguments) 1558TypeWithAnnotations.Create(type), 1597temp = new SynthesizedLocal(this.CurrentFunction, TypeWithAnnotations.Create(node.Type), SynthesizedLocalKind.LoweringTemp);
Operations\CSharpOperationFactory.cs (1)
1967TypeWithAnnotations.Create(((CSharpCompilation)_semanticModel.Compilation).GetSpecialType(SpecialType.System_Boolean)),
Symbols\AbstractTypeMap.cs (30)
59ImmutableArray<TypeWithAnnotations> oldTypeArguments = previous.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 61var newTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldTypeArguments.Length); 65var oldArgument = oldTypeArguments[i]; 66var newArgument = oldArgument.SubstituteType(this); 91internal TypeWithAnnotations SubstituteType(TypeSymbol previous) 94return default(TypeWithAnnotations); 124return TypeWithAnnotations.Create(result); 127internal TypeWithAnnotations SubstituteType(TypeWithAnnotations previous) 178protected virtual TypeWithAnnotations SubstituteTypeParameter(TypeParameterSymbol typeParameter) 180return TypeWithAnnotations.Create(typeParameter); 185var oldElement = t.ElementTypeWithAnnotations; 186TypeWithAnnotations element = oldElement.SubstituteType(this); 228var oldPointedAtType = t.PointedAtTypeWithAnnotations; 229var pointedAtType = oldPointedAtType.SubstituteType(this); 240var substitutedReturnType = f.Signature.ReturnTypeWithAnnotations.SubstituteType(this); 245ImmutableArray<TypeWithAnnotations> substitutedParamTypes = SubstituteTypes(parameterTypesWithAnnotations); 319internal ImmutableArray<TypeWithAnnotations> SubstituteTypes(ImmutableArray<TypeWithAnnotations> original) 323return default(ImmutableArray<TypeWithAnnotations>); 326var result = ArrayBuilder<TypeWithAnnotations>.GetInstance(original.Length); 328foreach (TypeWithAnnotations t in original) 342ImmutableArray<TypeWithAnnotations> original, 343ArrayBuilder<TypeWithAnnotations> result, 354var type = original[0]; 364foreach (var type in original) 369var substituted = substituteConstraintType(type); 386TypeWithAnnotations substituteConstraintType(TypeWithAnnotations type) 393TypeWithAnnotations substituted = SubstituteType(type);
Symbols\AbstractTypeParameterMap.cs (5)
20protected readonly SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> Mapping; 22protected AbstractTypeParameterMap(SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> mapping) 27protected sealed override TypeWithAnnotations SubstituteTypeParameter(TypeParameterSymbol typeParameter) 30TypeWithAnnotations result; 36return TypeWithAnnotations.Create(typeParameter);
Symbols\AnonymousTypes\AnonymousTypeDescriptor.cs (1)
101internal AnonymousTypeDescriptor WithNewFieldsTypes(ImmutableArray<TypeWithAnnotations> newFieldTypes)
Symbols\AnonymousTypes\AnonymousTypeField.cs (3)
21public readonly TypeWithAnnotations TypeWithAnnotations; 39TypeWithAnnotations typeWithAnnotations, 56public AnonymousTypeField WithType(TypeWithAnnotations type)
Symbols\AnonymousTypes\AnonymousTypeManager.cs (2)
56internal static ImmutableArray<TypeWithAnnotations> GetAnonymousTypeFieldTypes(NamedTypeSymbol type) 68public static NamedTypeSymbol ConstructAnonymousTypeSymbol(NamedTypeSymbol type, ImmutableArray<TypeWithAnnotations> newFieldTypes)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (5)
199var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(nTypeArguments); 231var original = TypeWithAnnotations.Create(genericFieldTypes[index].Type); 233var replacement = TypeWithAnnotations.Create(((ArrayTypeSymbol)lastParam.Type).WithElementType(original));
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
93internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 95get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (2)
58public override TypeWithAnnotations ReturnTypeWithAnnotations 60get { return TypeWithAnnotations.Create(this.Manager.System_Void); }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (9)
60new SynthesizedDelegateInvokeMethod.ParameterDescription(TypeWithAnnotations.Create(typeParams[i]), refKinds.IsNull ? RefKind.None : refKinds[i], ScopedKind.None, defaultValue: null, isParams: false, hasUnscopedRefAttribute: false)); 64var returnType = TypeWithAnnotations.Create(voidReturnTypeOpt ?? typeParams[parameterCount]); 126var type = TypeWithAnnotations.Create(typeParams[i]); 131type = TypeWithAnnotations.Create(ArrayTypeSymbol.CreateSZArray(containingType.ContainingAssembly, type)); 139var returnType = TypeWithAnnotations.Create(returnsVoid ? returnParameter.Type : typeParams[parameterCount]); 199var returnType = typeMap.SubstituteType(returnParameter.Type);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.EqualsMethodSymbol.cs (3)
25SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(this.Manager.System_Object), 0, RefKind.None, "value")); 43public override TypeWithAnnotations ReturnTypeWithAnnotations 45get { return TypeWithAnnotations.Create(this.Manager.System_Boolean); }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
30internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.GetHashCodeMethodSymbol.cs (2)
47public override TypeWithAnnotations ReturnTypeWithAnnotations 49get { return TypeWithAnnotations.Create(this.Manager.System_Int32); }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
44public override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (4)
22private readonly TypeWithAnnotations _typeWithAnnotations; 29internal AnonymousTypePropertySymbol(AnonymousTypeTemplateSymbol container, AnonymousTypeField field, TypeWithAnnotations fieldTypeWithAnnotations, int index) : 42TypeWithAnnotations fieldTypeWithAnnotations, 69public override TypeWithAnnotations TypeWithAnnotations
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
108public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 110get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
63AnonymousTypePropertySymbol property = new AnonymousTypePropertySymbol(this, field, TypeWithAnnotations.Create(typeParameter), fieldIndex);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ToStringMethodSymbol.cs (2)
47public override TypeWithAnnotations ReturnTypeWithAnnotations 49get { return TypeWithAnnotations.Create(this.Manager.System_String, NullableAnnotation.NotAnnotated); }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
242internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (2)
118internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 120return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\ArrayTypeSymbol.cs (24)
21private readonly TypeWithAnnotations _elementTypeWithAnnotations; 25TypeWithAnnotations elementTypeWithAnnotations, 37TypeWithAnnotations elementTypeWithAnnotations, 49TypeWithAnnotations elementTypeWithAnnotations, 66TypeWithAnnotations elementType, 75TypeWithAnnotations elementTypeWithAnnotations, 82TypeWithAnnotations elementTypeWithAnnotations, 91TypeWithAnnotations elementType) 96internal ArrayTypeSymbol WithElementType(TypeWithAnnotations elementTypeWithAnnotations) 101protected abstract ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations); 104TypeWithAnnotations elementTypeWithAnnotations, 200public TypeWithAnnotations ElementTypeWithAnnotations 392TypeWithAnnotations oldElementType = ElementTypeWithAnnotations; 393TypeWithAnnotations newElementType; 405internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 413TypeWithAnnotations elementType = ElementTypeWithAnnotations.MergeEquivalentTypes(((ArrayTypeSymbol)other).ElementTypeWithAnnotations, variance); 499TypeWithAnnotations elementTypeWithAnnotations, 508protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations newElementType) 557TypeWithAnnotations elementTypeWithAnnotations, 591TypeWithAnnotations elementTypeWithAnnotations, 598protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations) 618TypeWithAnnotations elementTypeWithAnnotations, 631protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations)
Symbols\AssemblySymbol.cs (4)
730return ArrayTypeSymbol.CreateCSharpArray(this, TypeWithAnnotations.Create(symbol), rank); 740return new PointerTypeSymbol(TypeWithAnnotations.Create(symbol)); 835var typeArgumentSymbols = ArrayBuilder<TypeWithAnnotations>.GetInstance(length); 843typeArgumentSymbols.Add(TypeWithAnnotations.Create(argSymbol));
Symbols\Compilation_WellKnownMembers.cs (3)
761var boolArray = ArrayTypeSymbol.CreateSZArray(booleanType.ContainingAssembly, TypeWithAnnotations.Create(booleanType)); 778var stringArray = ArrayTypeSymbol.CreateSZArray(stringType.ContainingAssembly, TypeWithAnnotations.Create(stringType)); 982void handle(RefKind refKind, ImmutableArray<CustomModifier> customModifiers, TypeWithAnnotations twa)
Symbols\ConstraintsHelper.cs (32)
74ImmutableArray<TypeWithAnnotations> constraintTypes, 103ImmutableArray<TypeWithAnnotations> constraintTypes, 123var constraintTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 130foreach (var constraintType in constraintTypes) 315internal static ImmutableArray<ImmutableArray<TypeWithAnnotations>> MakeTypeParameterConstraintTypes( 325return ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 339return ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 839ImmutableArray<TypeWithAnnotations> typeArguments, 876TypeWithAnnotations typeArgument, 955TypeWithAnnotations typeArgument, 981var constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 983ImmutableArray<TypeWithAnnotations> originalConstraintTypes = typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 995foreach (var constraintType in constraintTypes) 1015static bool errorIfNotSatisfiesConstructorConstraint(Symbol containingSymbol, TypeParameterSymbol typeParameter, TypeWithAnnotations typeArgument, ArrayBuilder<TypeParameterDiagnosticInfo> diagnosticsBuilder) 1041TypeWithAnnotations typeArgument, 1065TypeWithAnnotations typeArgument, 1069TypeWithAnnotations constraintType, 1121static NullableFlowState getTypeArgumentState(in TypeWithAnnotations typeWithAnnotations) 1145foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1160static bool constraintTypeAllows(in TypeWithAnnotations typeWithAnnotations, NullableFlowState state) 1182foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1241TypeWithAnnotations typeArgument, 1242TypeWithAnnotations constraintType, 1283foreach (var typeArgumentConstraint in typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1326private static bool IsReferenceType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1331private static bool IsValueType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1519internal static TypeWithAnnotations ConstraintWithMostSignificantNullability(TypeWithAnnotations type1, TypeWithAnnotations type2) 1539internal static bool IsObjectConstraint(TypeWithAnnotations type, ref TypeWithAnnotations bestObjectConstraint) 1565internal static bool IsObjectConstraintSignificant(bool? isNotNullable, TypeWithAnnotations objectConstraint)
Symbols\ConstructedMethodSymbol.cs (3)
16private readonly ImmutableArray<TypeWithAnnotations> _typeArgumentsWithAnnotations; 18internal ConstructedMethodSymbol(MethodSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations) 27public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations
Symbols\ConstructedNamedTypeSymbol.cs (6)
33internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 59private readonly ImmutableArray<TypeWithAnnotations> _typeArgumentsWithAnnotations; 62internal ConstructedNamedTypeSymbol(NamedTypeSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, bool unbound = false, TupleExtraData tupleData = null) 88internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 96internal static bool TypeParametersMatchTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments) 122foreach (var typeArg in typeArguments)
Symbols\DiscardSymbol.cs (2)
13public DiscardSymbol(TypeWithAnnotations typeWithAnnotations) 19public TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\DynamicTypeSymbol.cs (2)
226internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\ErrorMethodSymbol.cs (4)
153public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 155get { return ImmutableArray<TypeWithAnnotations>.Empty; } 163public override TypeWithAnnotations ReturnTypeWithAnnotations 165get { return TypeWithAnnotations.Create(_returnType); }
Symbols\ErrorPropertySymbol.cs (3)
28private readonly TypeWithAnnotations _typeWithAnnotations; 36_typeWithAnnotations = TypeWithAnnotations.Create(type); 46public override TypeWithAnnotations TypeWithAnnotations { get { return _typeWithAnnotations; } }
Symbols\ErrorTypeSymbol.cs (8)
40internal TypeWithAnnotations Substitute(AbstractTypeMap typeMap) 42return TypeWithAnnotations.Create(typeMap.SubstituteNamedType(this)); 297internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 458protected override NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 631private readonly ImmutableArray<TypeWithAnnotations> _typeArgumentsWithAnnotations; 634public ConstructedErrorTypeSymbol(ErrorTypeSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, TupleExtraData? tupleData = null) : 652internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 691internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
154internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 156return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\EventSymbol.cs (1)
53public abstract TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\FieldSymbol.cs (2)
58public TypeWithAnnotations TypeWithAnnotations 77internal abstract TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (35)
29TypeWithAnnotations returnType; 33returnType = TypeWithAnnotations.Create(typeBinder.CreateErrorType()); 245TypeWithAnnotations returnType, 248ImmutableArray<TypeWithAnnotations> parameterTypes, 270TypeWithAnnotations returnTypeWithAnnotations, 272ImmutableArray<TypeWithAnnotations> parameterTypes, 332TypeWithAnnotations substitutedReturnType, 333ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 350var mergedReturnType = ReturnTypeWithAnnotations.MergeEquivalentTypes(signature.ReturnTypeWithAnnotations, returnVariance); 352var mergedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 356var paramMergedTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_parameters.Length); 369var mergedParameterType = thisParam.TypeWithAnnotations.MergeEquivalentTypes(otherParam.TypeWithAnnotations, paramVariance); 398public FunctionPointerMethodSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 400var transformedReturn = transform(ReturnTypeWithAnnotations); 402var transformedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 406var paramTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_parameters.Length); 409var transformedType = transform(param.TypeWithAnnotations); 442TypeWithAnnotations returnType, 445ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 463var substitutedType = substitutedParameterTypes[i]; 487TypeWithAnnotations returnTypeWithAnnotations, 489ImmutableArray<TypeWithAnnotations> parameterTypes, 518TypeWithAnnotations returnType, 546var returnType = TypeWithAnnotations.Create(retInfo.Type, customModifiers: CSharpCustomModifier.Convert(retInfo.CustomModifiers)); 566var paramType = TypeWithAnnotations.Create(param.Type, customModifiers: CSharpCustomModifier.Convert(param.CustomModifiers)); 602bool madeChanges = ReturnTypeWithAnnotations.ApplyNullableTransforms(defaultTransformFlag, transforms, ref position, out var newReturnType); 603var newParamTypes = ImmutableArray<TypeWithAnnotations>.Empty; 606var paramTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(Parameters.Length); 610madeParamChanges |= param.TypeWithAnnotations.ApplyNullableTransforms(defaultTransformFlag, transforms, ref position, out var newParamType); 765public override TypeWithAnnotations ReturnTypeWithAnnotations { get; } 820public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
16public FunctionPointerParameterSymbol(TypeWithAnnotations typeWithAnnotations, RefKind refKind, int ordinal, FunctionPointerMethodSymbol containingSymbol, ImmutableArray<CustomModifier> refCustomModifiers) 26public override TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (8)
33TypeWithAnnotations returnType, 36ImmutableArray<TypeWithAnnotations> parameterTypes, 48TypeWithAnnotations returnType, 50ImmutableArray<TypeWithAnnotations> parameterTypes, 60TypeWithAnnotations substitutedReturnType, 61ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 172internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\FunctionTypeSymbol.cs (2)
179internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\LocalSymbol.cs (1)
65public abstract TypeWithAnnotations TypeWithAnnotations
Symbols\MemberSignatureComparer.cs (10)
521TypeWithAnnotations unsubstitutedReturnType1; 526TypeWithAnnotations unsubstitutedReturnType2; 553var returnType1 = SubstituteType(typeMap1, unsubstitutedReturnType1); 554var returnType2 = SubstituteType(typeMap2, unsubstitutedReturnType2); 704private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap typeMap, HashSet<TypeSymbol> result) 706foreach (var type in types) 724var type1 = SubstituteType(typeMap1, param1.TypeWithAnnotations); 725var type2 = SubstituteType(typeMap2, param2.TypeWithAnnotations); 761private static TypeWithAnnotations SubstituteType(TypeMap typeMap, TypeWithAnnotations typeSymbol)
Symbols\MemberSymbolExtensions.cs (7)
51internal static ImmutableArray<TypeWithAnnotations> GetParameterTypes(this Symbol member) 60return ImmutableArray<TypeWithAnnotations>.Empty; 116foreach (var parameterType in member.GetParameterTypes()) 204var methodReturnType = method.ReturnTypeWithAnnotations; 210var paramType = param.TypeWithAnnotations; 253var type = property.TypeWithAnnotations; 259var paramType = param.TypeWithAnnotations;
Symbols\Metadata\PE\DynamicTypeDecoder.cs (11)
242ImmutableArray<TypeWithAnnotations> typeArguments = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 244ImmutableArray<TypeWithAnnotations> transformedTypeArguments = TransformTypeArguments(typeArguments); // Note, modifiers are not involved, this is behavior of the native compiler. 270private ImmutableArray<TypeWithAnnotations> TransformTypeArguments(ImmutableArray<TypeWithAnnotations> typeArguments) 277var transformedTypeArgsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 279foreach (var typeArg in typeArguments) 285return default(ImmutableArray<TypeWithAnnotations>); 360var transformedParameters = ImmutableArray<TypeWithAnnotations>.Empty; 364var paramsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount); 398static (TypeWithAnnotations, bool madeChanges) handle(ref DynamicTypeDecoder decoder, RefKind refKind, ImmutableArray<CustomModifier> refCustomModifiers, TypeWithAnnotations typeWithAnnotations)
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (4)
179TypeWithAnnotations fieldType; 260var substituted = candidateParam.TypeWithAnnotations.SubstituteType(candidateMethodTypeMap); 284TypeWithAnnotations candidateMethodType = candidateMethod.ReturnTypeWithAnnotations; 288var substituted = candidateMethodType.SubstituteType(candidateMethodTypeMap);
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (6)
73private TypeWithAnnotations? TransformTypeWithAnnotations(TypeWithAnnotations type) 130var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 136TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 181var transformedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 186var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(type.Signature.ParameterCount);
Symbols\Metadata\PE\NullableTypeDecoder.cs (5)
20internal static TypeWithAnnotations TransformType( 21TypeWithAnnotations metadataType, 56internal static TypeWithAnnotations TransformType(TypeWithAnnotations metadataType, byte defaultTransformFlag, ImmutableArray<byte> nullableTransformFlags) 64TypeWithAnnotations result;
Symbols\Metadata\PE\PEEventSymbol.cs (5)
29private readonly TypeWithAnnotations _eventTypeWithAnnotations; 86_eventTypeWithAnnotations = TypeWithAnnotations.Create(new UnsupportedMetadataTypeSymbol(mrEx)); 101var type = TypeWithAnnotations.Create(typeSymbol); 329public override TypeWithAnnotations TypeWithAnnotations
Symbols\Metadata\PE\PEFieldSymbol.cs (7)
127private TypeWithAnnotations.Boxed _lazyType; 316var type = TypeWithAnnotations.Create(typeSymbol, customModifiers: customModifiersArray); 335type = TypeWithAnnotations.Create(new PointerTypeSymbol(TypeWithAnnotations.Create(fixedElementType))); 340Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null); 393internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Metadata\PE\PEMethodSymbol.cs (3)
636public override TypeWithAnnotations ReturnTypeWithAnnotations => Signature.ReturnParam.TypeWithAnnotations; 918public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => IsGenericMethod ? GetTypeParametersAsTypeArguments() : ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (5)
509baseType = (NamedTypeSymbol)NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(decodedType), _handle, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 569typeSymbol = NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(typeSymbol), interfaceImpl, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 1624internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 1628return ImmutableArray<TypeWithAnnotations>.Empty; 2570internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Metadata\PE\PEParameterSymbol.cs (6)
154private readonly TypeWithAnnotations _typeWithAnnotations; 229TypeWithAnnotations typeWithAnnotations, 375var typeWithModifiers = TypeWithAnnotations.Create(type, customModifiers: CSharpCustomModifier.Convert(customModifiers)); 412TypeWithAnnotations type, 904public override TypeWithAnnotations TypeWithAnnotations
Symbols\Metadata\PE\PEPropertySymbol.cs (4)
35private readonly TypeWithAnnotations _propertyTypeWithAnnotations; 236var propertyTypeWithAnnotations = TypeWithAnnotations.Create(originalPropertyType, customModifiers: typeCustomModifiers); 591public override TypeWithAnnotations TypeWithAnnotations
Symbols\Metadata\PE\PETypeParameterSymbol.cs (19)
43private ImmutableArray<TypeWithAnnotations> _lazyDeclaredConstraintTypes; 150private ImmutableArray<TypeWithAnnotations> GetDeclaredConstraintTypes(ConsList<PETypeParameterSymbol> inProgress) 157ImmutableArray<TypeWithAnnotations> declaredConstraintTypes; 167var symbolsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 170TypeWithAnnotations bestObjectConstraint = default; 175TypeWithAnnotations type = GetConstraintTypeOrDefault(moduleSymbol, metadataReader, tokenDecoder, constraintHandle, ref hasUnmanagedModreqPattern); 208foreach (TypeWithAnnotations constraintType in symbolsBuilder) 229declaredConstraintTypes = ImmutableArray<TypeWithAnnotations>.Empty; 264private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymbol, MetadataReader metadataReader, MetadataDecoder tokenDecoder, GenericParameterConstraintHandle constraintHandle, ref bool hasUnmanagedModreqPattern) 302var type = TypeWithAnnotations.Create(typeSymbol); 308private static bool? IsNotNullableFromConstraintType(TypeWithAnnotations constraintType, ConsList<PETypeParameterSymbol> inProgress, out bool isNonNullableValueType) 353ImmutableArray<TypeWithAnnotations> constraintTypes = this.GetDeclaredConstraintTypes(inProgress); 379private static bool? IsNotNullableFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes, ConsList<PETypeParameterSymbol> inProgress, out bool isNonNullableValueType) 385foreach (TypeWithAnnotations constraintType in constraintTypes) 536var symbolsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 543TypeWithAnnotations type = GetConstraintTypeOrDefault(moduleSymbol, metadataReader, tokenDecoder, constraintHandle, ref hasUnmanagedModreqPattern); 607internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 610return (bounds != null) ? bounds.ConstraintTypes : ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Metadata\PE\SymbolFactory.cs (2)
167private static TypeWithAnnotations CreateType(TypeSymbol type, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers) 170return TypeWithAnnotations.Create(type, NullableAnnotation.Oblivious, CSharpCustomModifier.Convert(customModifiers));
Symbols\Metadata\PE\TupleTypeDecoder.cs (17)
100public static TypeWithAnnotations DecodeTupleTypesIfApplicable( 101TypeWithAnnotations metadataType, 114return TypeWithAnnotations.Create(new UnsupportedMetadataTypeSymbol()); 121TypeWithAnnotations.Create(decoded, metadataType.NullableAnnotation, metadataType.CustomModifiers); 211var parameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 216var paramsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(type.Signature.ParameterCount); 221var decodedParam = DecodeTypeInternal(param.TypeWithAnnotations); 238var decodedReturnType = DecodeTypeInternal(type.Signature.ReturnTypeWithAnnotations); 306private ImmutableArray<TypeWithAnnotations> DecodeTypeArguments(ImmutableArray<TypeWithAnnotations> typeArgs) 313var decodedArgs = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArgs.Length); 318TypeWithAnnotations typeArg = typeArgs[i]; 319TypeWithAnnotations decoded = DecodeTypeInternal(typeArg); 336TypeWithAnnotations decodedElementType = DecodeTypeInternal(type.ElementTypeWithAnnotations); 340private TypeWithAnnotations DecodeTypeInternal(TypeWithAnnotations typeWithAnnotations) 346TypeWithAnnotations.Create(decoded, typeWithAnnotations.NullableAnnotation, typeWithAnnotations.CustomModifiers);
Symbols\MethodSymbol.cs (8)
238public abstract TypeWithAnnotations ReturnTypeWithAnnotations { get; } 259public abstract ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations { get; } 267internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 844return Construct(typeArguments.SelectAsArray(a => TypeWithAnnotations.Create(a))); 847internal MethodSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 888internal ImmutableArray<TypeWithAnnotations> ParameterTypesWithAnnotations 1090internal virtual TypeWithAnnotations IteratorElementTypeWithAnnotations 1149var type = this.ReturnTypeWithAnnotations;
Symbols\MethodSymbolExtensions.cs (1)
84public static MethodSymbol ConstructIfGeneric(this MethodSymbol method, ImmutableArray<TypeWithAnnotations> typeArguments)
Symbols\MutableTypeMap.cs (2)
20: base(new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>()) 24internal void Add(TypeParameterSymbol key, TypeWithAnnotations value)
Symbols\NamedTypeSymbol.cs (38)
70internal abstract ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics { get; } 72internal ImmutableArray<TypeWithAnnotations> TypeArgumentsWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 76foreach (var typeArgument in result) 84internal TypeWithAnnotations TypeArgumentWithDefinitionUseSiteDiagnostics(int index, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 86var result = TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[index]; 894var typeArgument = typeArguments[i]; 895var otherTypeArgument = otherTypeArguments[i]; 927foreach (TypeWithAnnotations arg in this.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 941var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 947TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 948TypeWithAnnotations newTypeArgument; 967internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 974var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 980TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 981TypeWithAnnotations newTypeArgument = transform(oldTypeArgument); 994internal NamedTypeSymbol WithTypeArguments(ImmutableArray<TypeWithAnnotations> allTypeArguments) 1011var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1042ArrayBuilder<TypeWithAnnotations> allTypeArguments) 1063TypeWithAnnotations typeArgumentA = typeArgumentsA[i]; 1064TypeWithAnnotations typeArgumentB = typeArgumentsB[i]; 1066TypeWithAnnotations merged = typeArgumentA.MergeEquivalentTypes(typeArgumentB, typeArgumentVariance); 1168internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1170internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType(); 1174ImmutableArray<TypeWithAnnotations> modifiedArguments; 1178modifiedArguments = default(ImmutableArray<TypeWithAnnotations>); 1182modifiedArguments = typeArguments.SelectAsArray(t => TypeWithAnnotations.Create(t)); 1188internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 1193internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1230protected virtual NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1279foreach (var argument in TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1285internal ImmutableArray<TypeWithAnnotations> GetAllTypeArguments(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1287ArrayBuilder<TypeWithAnnotations> builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1292internal void GetAllTypeArguments(ArrayBuilder<TypeWithAnnotations> builder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1303internal void GetAllTypeArgumentsNoUseSiteDiagnostics(ArrayBuilder<TypeWithAnnotations> builder) 1322internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 1391foreach (TypeWithAnnotations arg in currentType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Symbols\NativeIntegerTypeSymbol.cs (9)
44internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty; 237internal TypeWithAnnotations SubstituteUnderlyingType(TypeWithAnnotations type) => type.SubstituteType(GetTypeMap()); 327public override TypeWithAnnotations ReturnTypeWithAnnotations => _container.SubstituteUnderlyingType(UnderlyingMethod.ReturnTypeWithAnnotations); 329public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => ImmutableArray<TypeWithAnnotations>.Empty; 393public override TypeWithAnnotations TypeWithAnnotations => _containingType.SubstituteUnderlyingType(_underlyingParameter.TypeWithAnnotations); 444public override TypeWithAnnotations TypeWithAnnotations => _container.SubstituteUnderlyingType(_underlyingProperty.TypeWithAnnotations);
Symbols\NullableAnnotationExtensions.cs (5)
104var flowState = TypeWithAnnotations.Create(type, annotation).ToTypeWithState().State; 108internal static ITypeSymbol GetPublicSymbol(this TypeWithAnnotations type) 113internal static ImmutableArray<ITypeSymbol> GetPublicSymbols(this ImmutableArray<TypeWithAnnotations> types) 118internal static CodeAnalysis.NullableAnnotation ToPublicAnnotation(this TypeWithAnnotations type) => 121internal static ImmutableArray<CodeAnalysis.NullableAnnotation> ToPublicAnnotations(this ImmutableArray<TypeWithAnnotations> types) =>
Symbols\OverriddenOrHiddenMembersHelpers.cs (2)
893var methodReturnType = method.ReturnTypeWithAnnotations; 898var propertyType = property.TypeWithAnnotations;
Symbols\ParameterSignature.cs (4)
18internal readonly ImmutableArray<TypeWithAnnotations> parameterTypesWithAnnotations; 22new ParameterSignature(ImmutableArray<TypeWithAnnotations>.Empty, default(ImmutableArray<RefKind>)); 24private ParameterSignature(ImmutableArray<TypeWithAnnotations> parameterTypesWithAnnotations, 38var types = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Symbols\ParameterSymbol.cs (1)
49public abstract TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\PlaceholderTypeArgumentSymbol.cs (3)
18private static readonly TypeWithAnnotations s_instance = TypeWithAnnotations.Create(new PlaceholderTypeArgumentSymbol()); 20public static ImmutableArray<TypeWithAnnotations> CreateTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters)
Symbols\PointerTypeSymbol.cs (9)
20private readonly TypeWithAnnotations _pointedAtType; 26internal PointerTypeSymbol(TypeWithAnnotations pointedAtType) 65public TypeWithAnnotations PointedAtTypeWithAnnotations 255TypeWithAnnotations oldPointedAtType = PointedAtTypeWithAnnotations; 256TypeWithAnnotations newPointedAtType; 268internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 276TypeWithAnnotations pointedAtType = PointedAtTypeWithAnnotations.MergeEquivalentTypes(((PointerTypeSymbol)other).PointedAtTypeWithAnnotations, VarianceKind.None); 280internal PointerTypeSymbol WithPointedAtType(TypeWithAnnotations newPointedAtType)
Symbols\PropertySymbol.cs (2)
85public abstract TypeWithAnnotations TypeWithAnnotations { get; } 116internal ImmutableArray<TypeWithAnnotations> ParameterTypesWithAnnotations
Symbols\PublicModel\Symbol.cs (6)
19protected static ImmutableArray<TypeWithAnnotations> ConstructTypeArguments(ITypeSymbol[] typeArguments) 21var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Length); 25builder.Add(TypeWithAnnotations.Create(type, (typeArg?.NullableAnnotation.ToInternalAnnotation() ?? NullableAnnotation.NotAnnotated))); 31protected static ImmutableArray<TypeWithAnnotations> ConstructTypeArguments(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<CodeAnalysis.NullableAnnotation> typeArgumentNullableAnnotations) 44var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(n); 49builder.Add(TypeWithAnnotations.Create(type, annotation));
Symbols\ReducedExtensionMethodSymbol.cs (9)
27private readonly ImmutableArray<TypeWithAnnotations> _typeArguments; 175var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 180var typeArg = typeArgsForConstraintsCheck[i]; 184builder.Add(TypeWithAnnotations.Create(ErrorTypeSymbol.UnknownResultType)); 222ImmutableArray<TypeWithAnnotations> typeArgsForConstruct = typeArgs; 227(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp)); 283public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 484public override TypeWithAnnotations ReturnTypeWithAnnotations 620public override TypeWithAnnotations TypeWithAnnotations
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
49public override TypeWithAnnotations TypeWithAnnotations
Symbols\Retargeting\RetargetingFieldSymbol.cs (1)
60internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Retargeting\RetargetingMethodSymbol.cs (5)
55private TypeWithAnnotations.Boxed _lazyReturnType; 114public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 124return ImmutableArray<TypeWithAnnotations>.Empty; 129public override TypeWithAnnotations ReturnTypeWithAnnotations 136new TypeWithAnnotations.Boxed(this.RetargetingTranslator.Retarget(_underlyingMethod.ReturnTypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode, this.ContainingType)),
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (1)
89internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Retargeting\RetargetingParameterSymbol.cs (1)
37public sealed override TypeWithAnnotations TypeWithAnnotations
Symbols\Retargeting\RetargetingPropertySymbol.cs (5)
36private TypeWithAnnotations.Boxed _lazyType; 63public override TypeWithAnnotations TypeWithAnnotations 69var type = this.RetargetingTranslator.Retarget(_underlyingProperty.TypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 72type = TypeWithAnnotations.Create(asDynamic); 74Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (22)
180public TypeWithAnnotations Retarget(TypeWithAnnotations underlyingType, RetargetOptions options, NamedTypeSymbol asDynamicIfNoPiaContainingType = null) 515var oldArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 534var newArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldArguments.Count); 536foreach (var arg in oldArguments) 538var newArg = Retarget(arg, RetargetOptions.RetargetPrimitiveTypesByTypeCode); // generic instantiation is a signature 595private bool IsNoPiaIllegalGenericInstantiation(ArrayBuilder<TypeWithAnnotations> oldArguments, ArrayBuilder<TypeWithAnnotations> newArguments, int startOfNonInterfaceArguments) 671foreach (var argument in namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 697TypeWithAnnotations oldElement = type.ElementTypeWithAnnotations; 698TypeWithAnnotations newElement = Retarget(oldElement, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 748TypeWithAnnotations oldPointed = type.PointedAtTypeWithAnnotations; 749TypeWithAnnotations newPointed = Retarget(oldPointed, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 762var newReturn = Retarget(signature.ReturnTypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 766var newParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 772var newParameterTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(paramCount); 778var newParameterType = Retarget(parameter.TypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 869public ImmutableArray<TypeWithAnnotations> Retarget(ImmutableArray<TypeWithAnnotations> sequence) 871var result = ArrayBuilder<TypeWithAnnotations>.GetInstance(sequence.Length); 873foreach (var ts in sequence) 1139var targetType = Retarget(@event.TypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode);
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (1)
84internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress)
Symbols\SignatureOnlyMethodSymbol.cs (4)
30private readonly TypeWithAnnotations _returnType; 44TypeWithAnnotations returnType, 77public override TypeWithAnnotations ReturnTypeWithAnnotations { get { return _returnType; } } 123public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyParameterSymbol.cs (3)
17private readonly TypeWithAnnotations _type; 23TypeWithAnnotations type, 37public override TypeWithAnnotations TypeWithAnnotations { get { return _type; } }
Symbols\SignatureOnlyPropertySymbol.cs (3)
25private readonly TypeWithAnnotations _type; 35TypeWithAnnotations type, 52public override TypeWithAnnotations TypeWithAnnotations { get { return _type; } }
Symbols\Source\CrefTypeParameterSymbol.cs (2)
192internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 194return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Source\CustomModifierUtils.cs (2)
24out TypeWithAnnotations returnType, 50var sourceMethodReturnType = constructedSourceMethod.ReturnTypeWithAnnotations;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
398var type = this.TypeWithAnnotations;
Symbols\Source\GlobalExpressionVariable.cs (9)
20private TypeWithAnnotations.Boxed _lazyType; 69internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 83TypeWithAnnotations type; 112type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 126private TypeWithAnnotations SetType(BindingDiagnosticBag diagnostics, TypeWithAnnotations type) 137if (Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null) == null) 151internal TypeWithAnnotations SetTypeWithAnnotations(TypeWithAnnotations type, BindingDiagnosticBag diagnostics)
Symbols\Source\ImplicitNamedTypeSymbol.cs (2)
91internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 93get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Source\IndexedTypeParameterSymbol.cs (5)
102internal static ImmutableArray<TypeWithAnnotations> Take(int count) 109var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 113builder.Add(TypeWithAnnotations.Create(GetTypeParameter(i), NullableAnnotation.Ignored)); 207internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 209return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Source\LambdaParameterSymbol.cs (1)
19TypeWithAnnotations parameterType,
Symbols\Source\LambdaSymbol.cs (13)
22private TypeWithAnnotations _returnType; 44ImmutableArray<TypeWithAnnotations> parameterTypes, 47TypeWithAnnotations returnType) : 60_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 147public override TypeWithAnnotations ReturnTypeWithAnnotations 156internal void SetInferredReturnType(RefKind refKind, TypeWithAnnotations inferredReturnType) 184public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 186get { return ImmutableArray<TypeWithAnnotations>.Empty; } 302ImmutableArray<TypeWithAnnotations> parameterTypes, 332TypeWithAnnotations type; 351type = TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(compilation, name: string.Empty, arity: 0, errorInfo: null)); 406public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() => ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\LocalFunctionOrSourceMemberMethodSymbol.cs (8)
12private TypeWithAnnotations.Boxed? _lazyIteratorElementType; 19_lazyIteratorElementType = TypeWithAnnotations.Boxed.Sentinel; 23internal sealed override TypeWithAnnotations IteratorElementTypeWithAnnotations 27if (_lazyIteratorElementType == TypeWithAnnotations.Boxed.Sentinel) 29TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(DeclaringCompilation, RefKind, ReturnType, errorLocation: null, diagnostics: null); 33elementType = TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(DeclaringCompilation, name: "", arity: 0, errorInfo: null, unreported: false)); 36Interlocked.CompareExchange(ref _lazyIteratorElementType, new TypeWithAnnotations.Boxed(elementType), TypeWithAnnotations.Boxed.Sentinel);
Symbols\Source\LocalFunctionSymbol.cs (7)
26private ImmutableArray<ImmutableArray<TypeWithAnnotations>> _lazyTypeParameterConstraintTypes; 28private TypeWithAnnotations.Boxed? _lazyReturnType; 201public override TypeWithAnnotations ReturnTypeWithAnnotations 222TypeWithAnnotations returnType = WithTypeParametersBinder.BindType(returnTypeSyntax.SkipScoped(out _).SkipRef(), diagnostics); 269Interlocked.CompareExchange(ref _lazyReturnType, new TypeWithAnnotations.Boxed(returnType), null); 277public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => GetTypeParametersAsTypeArguments(); 433public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes()
Symbols\Source\ParameterHelpers.cs (5)
40parameterCreationFunc: (Binder context, Symbol owner, TypeWithAnnotations parameterType, 80parameterCreationFunc: (Binder binder, FunctionPointerMethodSymbol owner, TypeWithAnnotations parameterType, 122Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 179var parameterType = withTypeParametersBinder.BindType(parameterSyntax.Type, diagnostics, suppressUseSiteDiagnostics: suppressUseSiteDiagnostics); 614TypeWithAnnotations typeWithAnnotations,
Symbols\Source\SourceClonedParameterSymbol.cs (1)
83public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceComplexParameterSymbol.cs (3)
42TypeWithAnnotations parameterType, 1510TypeWithAnnotations parameterType, 1532TypeWithAnnotations parameterType,
Symbols\Source\SourceConstructorSymbolBase.cs (5)
20private TypeWithAnnotations _lazyReturnType; 60_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 147public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 148=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 158public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceCustomEventSymbol.cs (2)
19private readonly TypeWithAnnotations _type; 173public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceDelegateMethodSymbol.cs (24)
20private readonly TypeWithAnnotations _returnType; 24TypeWithAnnotations returnType, 53var returnType = binder.BindType(returnTypeSyntax, diagnostics); 56var voidType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 58var objectType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax)); 59var intPtrType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax)); 81var iAsyncResultType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax)); 82var asyncCallbackType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax)); 157public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 158=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 163public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 218TypeWithAnnotations voidType, 219TypeWithAnnotations objectType, 220TypeWithAnnotations intPtrType, 267TypeWithAnnotations returnType, 366TypeWithAnnotations iAsyncResultType, 367TypeWithAnnotations objectType, 368TypeWithAnnotations asyncCallbackType, 411TypeWithAnnotations iAsyncResultType,
Symbols\Source\SourceDestructorSymbol.cs (5)
16private TypeWithAnnotations _lazyReturnType; 73_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 107public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 108=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 118public override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceEnumConstantSymbol.cs (2)
61internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 63return TypeWithAnnotations.Create(this.ContainingType);
Symbols\Source\SourceEventAccessorSymbol.cs (8)
22private TypeWithAnnotations _lazyReturnType; 120_lazyReturnType = TypeWithAnnotations.Create(eventTokenType); 133_lazyReturnType = TypeWithAnnotations.Create(voidType); 136var parameter = new SynthesizedAccessorValueParameterSymbol(this, TypeWithAnnotations.Create(eventTokenType), 0); 147_lazyReturnType = TypeWithAnnotations.Create(voidType); 171public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 209public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 210=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\SourceEventSymbol.cs (4)
86public abstract override TypeWithAnnotations TypeWithAnnotations { get; } 321var type = this.TypeWithAnnotations; 615protected static void CopyEventCustomModifiers(EventSymbol eventWithCustomModifiers, ref TypeWithAnnotations type, AssemblySymbol containingAssembly) 730protected TypeWithAnnotations BindEventType(Binder binder, TypeSyntax typeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceFieldLikeEventSymbol.cs (2)
23private readonly TypeWithAnnotations _type; 142public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceLocalSymbol.cs (19)
37private TypeWithAnnotations.Boxed _type; 292public override TypeWithAnnotations TypeWithAnnotations 302TypeWithAnnotations localType = GetTypeSymbol(); 325TypeWithAnnotations declType = this.TypeSyntaxBinder.BindTypeOrVarKeyword(typeSyntax, BindingDiagnosticBag.Discarded, out isVar); 333private TypeWithAnnotations GetTypeSymbol() 348TypeWithAnnotations declType; 361var inferredType = InferTypeOfVarVariable(diagnostics); 372declType = TypeWithAnnotations.Create(typeBinder.CreateErrorType("var")); 381protected virtual TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 389internal void SetTypeWithAnnotations(TypeWithAnnotations newType) 392TypeWithAnnotations? originalType = _type?.Value; 403Interlocked.CompareExchange(ref _type, new TypeWithAnnotations.Boxed(newType), null); 543protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 546return TypeWithAnnotations.Create(initializerOpt?.Type); 628protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 663protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 682return TypeWithAnnotations.Create(_nodeBinder.CreateErrorType()); 747protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 797SetTypeWithAnnotations(TypeWithAnnotations.Create(_nodeBinder.CreateErrorType("var")));
Symbols\Source\SourceMemberContainerSymbol.cs (13)
4035TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4074TypeWithAnnotations.Create(this), 4082TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4122TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Text_StringBuilder)), 4129returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 4184returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_String)), 4358TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Int32)), 4387TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Type)), 4448TypeWithAnnotations.Create(this), 4456TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 5017builder.AddValue(TypeWithAnnotations.Create(baseType)); 5021builder.AddValue(TypeWithAnnotations.Create(@interface)); 5081AddSynthesizedAttribute(ref attributes, moduleBuilder.SynthesizeNullableAttributeIfNecessary(this, nullableContextValue, TypeWithAnnotations.Create(baseType)));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (12)
793foreach (var parameterType in parameterTypes) 953TypeWithAnnotations overridingMemberType = overridingEvent.TypeWithAnnotations; 954TypeWithAnnotations overriddenMemberType = overriddenEvent.TypeWithAnnotations; 1051TypeWithAnnotations overridingMemberType = overridingProperty.TypeWithAnnotations; 1052TypeWithAnnotations overriddenMemberType = overriddenProperty.TypeWithAnnotations; 1199private bool IsValidOverrideReturnType(Symbol overridingSymbol, TypeWithAnnotations overridingReturnType, TypeWithAnnotations overriddenReturnType, BindingDiagnosticBag diagnostics) 1265var overrideReturnType = getNotNullIfNotNullOutputType(overrideMethod.ReturnTypeWithAnnotations, overrideMethod.ReturnNotNullIfParameterNotNull); 1295var baseParameterType = baseParameter.TypeWithAnnotations; 1298var overrideParameterType = getNotNullIfNotNullOutputType(overrideParameter.TypeWithAnnotations, overrideParameter.NotNullIfParameterNotNull); 1325TypeWithAnnotations getNotNullIfNotNullOutputType(TypeWithAnnotations outputType, ImmutableHashSet<string> notNullIfParameterNotNull)
Symbols\Source\SourceMemberFieldSymbol.cs (8)
320internal readonly TypeWithAnnotations Type; 322internal TypeAndRefKind(RefKind refKind, TypeWithAnnotations type) 427internal sealed override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 448TypeWithAnnotations type; 469type = TypeWithAnnotations.Create(tokenTableType.Construct(ImmutableArray.Create(@event.TypeWithAnnotations))); 541type = TypeWithAnnotations.Create(initializerOpt.Type); 550type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 557type = TypeWithAnnotations.Create(new PointerTypeSymbol(type));
Symbols\Source\SourceMemberMethodSymbol.cs (4)
241protected void CheckEffectiveAccessibility(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 275protected void CheckFileTypeUsage(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 693public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 781var unusedType = this.ReturnTypeWithAnnotations;
Symbols\Source\SourceMethodSymbol.cs (1)
23public abstract ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes();
Symbols\Source\SourceNamedTypeSymbol.cs (24)
32private ImmutableArray<ImmutableArray<TypeWithAnnotations>> _lazyTypeParameterConstraintTypes; 272internal ImmutableArray<TypeWithAnnotations> GetTypeParameterConstraintTypes(int ordinal) 275return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty; 278private ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 318private ImmutableArray<ImmutableArray<TypeWithAnnotations>> MakeTypeParameterConstraintTypes(BindingDiagnosticBag diagnostics) 512ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 513ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes = null; 514SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap = null; 561static bool mergeConstraints(ImmutableArray<TypeWithAnnotations> originalConstraintTypes, 562ref SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap, ref ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes, 582TypeWithAnnotations.EqualsComparer.IgnoreNullableModifiersForReferenceTypesComparer); 583SmallDictionary<TypeWithAnnotations, int> clauseConstraintTypesMap = toDictionary(clause.ConstraintTypes, originalConstraintTypesMap.Comparer); 587TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1]; 597TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2]; 611mergedConstraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(originalConstraintTypes.Length); 619foreach (var constraintType in clauseConstraintTypesMap.Keys) 631static SmallDictionary<TypeWithAnnotations, int> toDictionary(ImmutableArray<TypeWithAnnotations> constraintTypes, IEqualityComparer<TypeWithAnnotations> comparer) 633var result = new SmallDictionary<TypeWithAnnotations, int>(comparer); 666ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 699static void mergeConstraints(ref TypeParameterConstraintKind mergedKind, ImmutableArray<TypeWithAnnotations> originalConstraintTypes, TypeParameterConstraintClause clause) 740internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
348return TypeWithAnnotations.Create(type).VisitType(
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (3)
22private TypeWithAnnotations _lazyReturnType; 40protected MethodSymbol? MethodChecks(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 192public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceOrdinaryMethodSymbol.cs (6)
33private ImmutableArray<ImmutableArray<TypeWithAnnotations>> _lazyTypeParameterConstraintTypes; 122protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 148TypeWithAnnotations returnType = signatureBinder.BindType(returnTypeSyntax, diagnostics); 199static void forceMethodTypeParameters(TypeWithAnnotations type, SourceOrdinaryMethodSymbol method, ImmutableArray<TypeParameterConstraintClause> declaredConstraints) 221var parameter0Type = this.Parameters[0].TypeWithAnnotations; 309public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes()
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
131protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics);
Symbols\Source\SourceParameterSymbol.cs (5)
24protected readonly TypeWithAnnotations parameterType; 33TypeWithAnnotations parameterType, 101TypeWithAnnotations parameterType, 132TypeWithAnnotations newTypeWithModifiers = this.TypeWithAnnotations.WithTypeAndModifiers(newType, newCustomModifiers); 268public sealed override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceParameterSymbolBase.cs (1)
89var type = this.TypeWithAnnotations;
Symbols\Source\SourcePropertyAccessorSymbol.cs (8)
21private TypeWithAnnotations _lazyReturnType; 282var type = associatedProperty.TypeWithAnnotations; 335public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 336=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 346public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 379private TypeWithAnnotations ComputeReturnType(BindingDiagnosticBag diagnostics) 388var type = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, this.GetSyntax()));
Symbols\Source\SourcePropertySymbol.cs (3)
438protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 446private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 452var type = binder.BindType(typeSyntax, diagnostics);
Symbols\Source\SourcePropertySymbolBase.cs (8)
56private TypeWithAnnotations.Boxed _lazyType; 173TypeWithAnnotations type; 175_lazyType = new TypeWithAnnotations.Boxed(type); 218TypeWithAnnotations overriddenPropertyType = overriddenOrImplementedProperty.TypeWithAnnotations; 229_lazyType = new TypeWithAnnotations.Boxed(type); 290public sealed override TypeWithAnnotations TypeWithAnnotations 1122var type = this.TypeWithAnnotations; 1554protected abstract (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics);
Symbols\Source\SourceSimpleParameterSymbol.cs (1)
18TypeWithAnnotations parameterType,
Symbols\Source\SourceTypeParameterSymbol.cs (4)
91internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 94return (bounds != null) ? bounds.ConstraintTypes : ImmutableArray<TypeWithAnnotations>.Empty; 262foreach (var constraintType in constraintTypes) 710var constraintTypes = constraints.IsEmpty ? ImmutableArray<TypeWithAnnotations>.Empty : constraints[Ordinal];
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
127protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics)
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
127protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (5)
216protected (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BaseMethodDeclarationSyntax declarationSyntax, TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics) 218TypeWithAnnotations returnType; 287protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics); 795public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 796=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\ThisParameterSymbol.cs (2)
32public override TypeWithAnnotations TypeWithAnnotations 33=> TypeWithAnnotations.Create(_containingType, NullableAnnotation.NotAnnotated);
Symbols\Source\TypeParameterConstraintClause.cs (7)
74ImmutableArray<TypeWithAnnotations>.Empty); 78ImmutableArray<TypeWithAnnotations>.Empty); 82ImmutableArray<TypeWithAnnotations> constraintTypes) 102ImmutableArray<TypeWithAnnotations> constraintTypes) 126public readonly ImmutableArray<TypeWithAnnotations> ConstraintTypes; 168foreach (TypeWithAnnotations constraintType in constraintClause.ConstraintTypes) 228foreach (TypeWithAnnotations constraintType in constraintClause.ConstraintTypes)
Symbols\SubstitutedEventSymbol.cs (4)
15private TypeWithAnnotations.Boxed? _lazyType; 24public override TypeWithAnnotations TypeWithAnnotations 30var type = _containingType.TypeSubstitution.SubstituteType(OriginalDefinition.TypeWithAnnotations); 31Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null);
Symbols\SubstitutedFieldSymbol.cs (4)
19private TypeWithAnnotations.Boxed _lazyType; 27internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 31var type = _containingType.TypeSubstitution.SubstituteType(OriginalDefinition.GetFieldType(fieldsBeingBound)); 32Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null);
Symbols\SubstitutedMethodSymbol.cs (6)
28private TypeWithAnnotations.Boxed _lazyReturnType; 133public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 227public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 233var returnType = Map.SubstituteType(OriginalDefinition.ReturnTypeWithAnnotations); 234Interlocked.CompareExchange(ref _lazyReturnType, new TypeWithAnnotations.Boxed(returnType), null); 390foreach (var arg in this.TypeArgumentsWithAnnotations)
Symbols\SubstitutedParameterSymbol.cs (3)
45public override TypeWithAnnotations TypeWithAnnotations 50if (mapOrType is TypeWithAnnotations type) 55TypeWithAnnotations substituted = ((TypeMap)mapOrType).SubstituteType(this._underlyingParameter.TypeWithAnnotations);
Symbols\SubstitutedPropertySymbol.cs (4)
16private TypeWithAnnotations.Boxed _lazyType; 25public override TypeWithAnnotations TypeWithAnnotations 31var type = _containingType.TypeSubstitution.SubstituteType(OriginalDefinition.TypeWithAnnotations); 32Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null);
Symbols\SubstitutedTypeParameterSymbol.cs (6)
99internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 101var constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 104TypeWithAnnotations bestObjectConstraint = default; 109TypeWithAnnotations type = constraintTypes[i]; 131foreach (TypeWithAnnotations constraintType in constraintTypes) 161var constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Symbols\Symbol.cs (4)
1090internal bool DeriveUseSiteInfoFromType(ref UseSiteInfo<AssemblySymbol> result, TypeWithAnnotations type, AllowedRequiredModifierType allowedRequiredModifierType) 1204internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1206foreach (var t in types) 1528foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics)
Symbols\Symbol_Attributes.cs (1)
535var boundType = binder.BindType(attributeSyntax.Name, BindingDiagnosticBag.Discarded);
Symbols\SymbolExtensions.cs (6)
33public static NamedTypeSymbol ConstructIfGeneric(this NamedTypeSymbol type, ImmutableArray<TypeWithAnnotations> typeArguments) 92public static bool IsNoMoreVisibleThan(this Symbol symbol, TypeWithAnnotations type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 437internal static TypeWithAnnotations GetTypeOrReturnType(this Symbol symbol) 439TypeWithAnnotations returnType; 481internal static void GetTypeOrReturnType(this Symbol symbol, out RefKind refKind, out TypeWithAnnotations returnType, 524returnType = TypeWithAnnotations.Create((TypeSymbol)symbol);
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
49internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (3)
32protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 36return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 39TypeWithAnnotations.Create(ContainingType.BaseTypeNoUseSiteDiagnostics, NullableAnnotation.Annotated),
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (2)
99protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 103TypeWithAnnotations.Create(isNullableEnabled: true, ContainingType),
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
26TypeWithAnnotations.Create(
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
38protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 42return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Void, location, diagnostics)),
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (2)
74protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 76return (TypeWithAnnotations.Create(Binder.GetWellKnownType(DeclaringCompilation, WellKnownType.System_Type, diagnostics, Location), NullableAnnotation.NotAnnotated),
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (4)
64protected sealed override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 69return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 72TypeWithAnnotations.Create(ContainingType, annotation), 75TypeWithAnnotations.Create(ContainingType, annotation),
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (3)
35protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) 41return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 44TypeWithAnnotations.Create(ContainingType, annotation),
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (2)
29protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) 34return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Int32, location, diagnostics)),
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (3)
26protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) 32return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 35TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Object, location, diagnostics), annotation),
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (2)
44public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() => ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
88protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 93return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 96TypeWithAnnotations.Create(Binder.GetWellKnownType(compilation, WellKnownType.System_Text_StringBuilder, diagnostics, location), annotation),
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
86protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (2)
39protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, bool IsVararg, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 44return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, location, diagnostics), annotation),
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
20public SynthesizedAccessorValueParameterSymbol(SourceMemberMethodSymbol accessor, TypeWithAnnotations paramType, int ordinal)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
116internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Synthesized\SynthesizedContainer.cs (1)
98internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (8)
21SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(objectType), 0, RefKind.None, "object"), 22SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intPtrType), 1, RefKind.None, "method")); 35internal ParameterDescription(TypeWithAnnotations type, RefKind refKind, ScopedKind scope, ConstantValue? defaultValue, bool isParams, bool hasUnscopedRefAttribute) 45internal readonly TypeWithAnnotations Type; 58TypeWithAnnotations returnType, 165public override TypeWithAnnotations ReturnTypeWithAnnotations { get; } 171public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 173get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
98internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (3)
32var boolArrayType = TypeWithAnnotations.Create( 35TypeWithAnnotations.Create(boolType)));
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (4)
34var annotatedByteType = TypeWithAnnotations.Create(systemByteType); 36var byteArrayType = TypeWithAnnotations.Create(
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
41m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(systemByteType), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
41m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(systemBooleanType), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEmbeddedRefSafetyRulesAttributeSymbol.cs (1)
39m => ImmutableArray.Create(SynthesizedParameterSymbol.Create(m, TypeWithAnnotations.Create(int32Type), 0, RefKind.None)),
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (14)
44return new ScriptEntryPoint(containingType, TypeWithAnnotations.Create(systemVoid)); 125public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 127get { return ImmutableArray<TypeWithAnnotations>.Empty; } 379public override TypeWithAnnotations ReturnTypeWithAnnotations => TypeWithAnnotations.Create(_getAwaiterGetResultCall.Type); 431private readonly TypeWithAnnotations _returnType; 433internal ScriptEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType) : 445public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 471new SynthesizedLocal(this, TypeWithAnnotations.Create(_containingType), SynthesizedLocalKind.LoweringTemp), 520private readonly TypeWithAnnotations _returnType; 522internal SubmissionEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType, TypeSymbol submissionArrayType) : 528TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray")); 543public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 563new SynthesizedLocal(this, TypeWithAnnotations.Create(_containingType), SynthesizedLocalKind.LoweringTemp),
Symbols\Synthesized\SynthesizedEnumValueFieldSymbol.cs (2)
33internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 35return TypeWithAnnotations.Create(((SourceNamedTypeSymbol)ContainingType).EnumUnderlyingType);
Symbols\Synthesized\SynthesizedFieldSymbol.cs (3)
21private readonly TypeWithAnnotations _type; 33_type = TypeWithAnnotations.Create(type); 45internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
51var typeWithAnnotations = this.TypeWithAnnotations; 87internal abstract override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound);
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (4)
203public override TypeWithAnnotations ReturnTypeWithAnnotations 205get { return TypeWithAnnotations.Create(_returnType); } 218public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 220get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
91public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 101public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (4)
154public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 156get { return TypeWithAnnotations.Create(ContainingAssembly.GetSpecialType(SpecialType.System_Void)); } 168public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 170get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (4)
144public override TypeWithAnnotations ReturnTypeWithAnnotations 146get { return TypeWithAnnotations.Create(_returnType); } 158public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 160get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (5)
224public override TypeWithAnnotations ReturnTypeWithAnnotations 228return TypeWithAnnotations.Create(_returnType); 238public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 242return ImmutableArray<TypeWithAnnotations>.Empty; 468) : base(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, ScopedKind.None, name)
Symbols\Synthesized\SynthesizedLambdaCacheFieldSymbol.cs (3)
16private readonly TypeWithAnnotations _type; 24_type = TypeWithAnnotations.Create(type); 40internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Synthesized\SynthesizedLocal.cs (3)
22private readonly TypeWithAnnotations _type; 36TypeWithAnnotations type, 138public sealed override TypeWithAnnotations TypeWithAnnotations
Symbols\Synthesized\SynthesizedParameterSymbol.cs (7)
19private readonly TypeWithAnnotations _type; 27TypeWithAnnotations type, 45public override TypeWithAnnotations TypeWithAnnotations => _type; 150var type = this.TypeWithAnnotations; 222TypeWithAnnotations type, 237TypeWithAnnotations type, 326TypeWithAnnotations type,
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (3)
189public override TypeWithAnnotations ReturnTypeWithAnnotations 201public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 205return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (6)
65TypeWithAnnotations.Create( 67TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, NoLocation.Singleton, diagnostics)))), 0, RefKind.None, "args")); 154public override TypeWithAnnotations ReturnTypeWithAnnotations 158return TypeWithAnnotations.Create(_returnType); 203public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 204=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (4)
135public override TypeWithAnnotations ReturnTypeWithAnnotations 139return TypeWithAnnotations.Create(ContainingAssembly.GetSpecialType(SpecialType.System_Void)); 157public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 161return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedStringHashFunctionSymbol.cs (2)
21this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "s"))); 31this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "s")));
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
29SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray"));
Symbols\Synthesized\SynthesizedThrowIfNullMethod.cs (2)
22SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(argumentParamType), ordinal: 0, RefKind.None, "argument"), 23SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramNameParamType), ordinal: 1, RefKind.None, "paramName")));
Symbols\Synthesized\SynthesizedThrowMethod.cs (1)
18this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "paramName")));
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
19this.SetParameters(ImmutableArray.Create(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(paramType), 0, RefKind.None, "unmatchedValue")));
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (3)
17private readonly TypeWithAnnotations _type; 20public TypeSubstitutedLocalSymbol(LocalSymbol originalVariable, TypeWithAnnotations type, Symbol containingSymbol) 77public override TypeWithAnnotations TypeWithAnnotations
Symbols\Tuples\TupleErrorFieldSymbol.cs (3)
20private readonly TypeWithAnnotations _type; 43TypeWithAnnotations type, 161internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Tuples\TupleFieldSymbol.cs (2)
128internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 321internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Tuples\TupleTypeSymbol.cs (11)
32ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 80static NamedTypeSymbol getTupleUnderlyingType(ImmutableArray<TypeWithAnnotations> elementTypes, CSharpSyntaxNode? syntax, CSharpCompilation compilation, BindingDiagnosticBag? diagnostics) 133internal NamedTypeSymbol WithElementTypes(ImmutableArray<TypeWithAnnotations> newElementTypes) 238private static NamedTypeSymbol ConstructTupleUnderlyingType(NamedTypeSymbol firstTupleType, NamedTypeSymbol? chainedTupleTypeOpt, ImmutableArray<TypeWithAnnotations> elementTypes) 250var chainedTypes = ImmutableArray.Create(elementTypes, (loop - 1) * (ValueTupleRestPosition - 1), ValueTupleRestPosition - 1).Add(TypeWithAnnotations.Create(currentSymbol)); 565public sealed override ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations 915private ImmutableArray<TypeWithAnnotations> _lazyElementTypes; 974public ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 984static ImmutableArray<TypeWithAnnotations> collectTupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 986ImmutableArray<TypeWithAnnotations> elementTypes; 992var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(ValueTupleRestPosition - 1 + extensionTupleElementTypes.Length);
Symbols\TypeMap.cs (21)
24public static readonly Func<TypeWithAnnotations, TypeSymbol> AsTypeSymbol = t => t.Type; 26internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 28return typeParameters.SelectAsArray(static (tp) => TypeWithAnnotations.Create(tp)); 31internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithIgnoredAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 33return typeParameters.SelectAsArray(static (tp) => TypeWithAnnotations.Create(tp, NullableAnnotation.Ignored)); 36internal static ImmutableArray<TypeSymbol> AsTypeSymbols(ImmutableArray<TypeWithAnnotations> typesOpt) 42internal TypeMap(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to, bool allowAlpha = false) 56private TypeMap(SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> mapping) 57: base(new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(mapping, ReferenceEqualityComparer.Instance)) 62private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ForType(NamedTypeSymbol containingType) 66new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(substituted.TypeSubstitution.Mapping, ReferenceEqualityComparer.Instance) : 67new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 70internal TypeMap(NamedTypeSymbol containingType, ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments) 76TypeWithAnnotations ta = typeArguments[i]; 84private static readonly SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> s_emptyDictionary = 85new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 130result.Mapping.Add(tp, TypeWithAnnotations.Create(newTp)); 200private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ConstructMapping(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to) 202var mapping = new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 209TypeWithAnnotations ta = to[i];
Symbols\TypeParameterBounds.cs (2)
24ImmutableArray<TypeWithAnnotations> constraintTypes, 50public readonly ImmutableArray<TypeWithAnnotations> ConstraintTypes;
Symbols\TypeParameterSymbol.cs (14)
82internal ImmutableArray<TypeWithAnnotations> ConstraintTypesNoUseSiteDiagnostics 91internal ImmutableArray<TypeWithAnnotations> ConstraintTypesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 97foreach (var constraint in result) 383internal abstract ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress); 436internal static bool CalculateIsReferenceTypeFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 438foreach (var constraintType in constraintTypes) 448internal static bool? IsNotNullableFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 453foreach (TypeWithAnnotations constraintType in constraintTypes) 469internal static bool? IsNotNullableFromConstraintType(TypeWithAnnotations constraintType, out bool isNonNullableValueType) 506internal static bool CalculateIsValueTypeFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 508foreach (var constraintType in constraintTypes) 555ImmutableArray<TypeWithAnnotations> constraintTypes = this.ConstraintTypesNoUseSiteDiagnostics; 684internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\TypeParameterSymbolExtensions.cs (1)
21foreach (var constraintType in typeParameter1.ConstraintTypesNoUseSiteDiagnostics)
Symbols\TypeSymbol.cs (8)
576public virtual ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations => default(ImmutableArray<TypeWithAnnotations>); 626return TypeWithAnnotations.NeedsNullableAttribute(typeWithAnnotationsOpt: default, typeOpt: this); 633internal abstract TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform); 640private static readonly Func<TypeWithAnnotations, TypeWithAnnotations> s_setUnknownNullability = 2398internal bool Equals(TypeWithAnnotations other)
Symbols\TypeSymbolExtensions.cs (31)
112foreach (var constraintType in constraintTypes) 149public static TypeWithAnnotations GetNullableUnderlyingTypeWithAnnotations(this TypeSymbol type) 532public static bool TryGetElementTypesWithAnnotationsIfTupleType(this TypeSymbol type, out ImmutableArray<TypeWithAnnotations> elementTypes) 541elementTypes = default(ImmutableArray<TypeWithAnnotations>); 668/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.DefaultType"/> 669/// instead of <see cref="TypeWithAnnotations.Type"/> to avoid early resolution of nullable types</param> 671this TypeWithAnnotations typeWithAnnotationsOpt, 673Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, 751TypeWithAnnotations next; 781(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(fields[i].TypeWithAnnotations, canDigThroughNullable); 812(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(typeArguments[i], canDigThroughNullable); 861static (TypeWithAnnotations, TypeSymbol?) getNextIterationElements(TypeWithAnnotations type, bool canDigThroughNullable) 862=> canDigThroughNullable ? (default(TypeWithAnnotations), type.NullableUnderlyingTypeOrSelf) : (type, null); 864static TypeSymbol? visitFunctionPointerType(FunctionPointerTypeSymbol type, Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, Func<TypeSymbol, T, bool, bool>? typePredicate, T arg, bool useDefaultType, bool canDigThroughNullable, bool visitCustomModifiers, out TypeWithAnnotations next) 891(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(currentPointer.Parameters[i].TypeWithAnnotations, canDigThroughNullable); 1164internal static bool ContainsNativeIntegerWrapperType(this TypeWithAnnotations type) 1504foreach (var arg in type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1861private static bool NormalizeTaskTypesInType(CSharpCompilation compilation, ref TypeWithAnnotations typeWithAnnotations) 1866typeWithAnnotations = TypeWithAnnotations.Create(type, customModifiers: typeWithAnnotations.CustomModifiers); 1879var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1884var typeWithModifier = typeArgumentsBuilder[i]; 1890typeArgumentsBuilder[i] = TypeWithAnnotations.Create(typeArgNormalized, customModifiers: typeWithModifier.CustomModifiers); 1930var elementType = arrayType.ElementTypeWithAnnotations; 1941var pointedAtType = pointerType.PointedAtTypeWithAnnotations; 1953var returnType = funcPtrType.Signature.ReturnTypeWithAnnotations; 1956var paramTypes = ImmutableArray<TypeWithAnnotations>.Empty; 1960var paramsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(funcPtrType.Signature.ParameterCount); 1964var paramType = param.TypeWithAnnotations; 1993this TypeWithAnnotations type,
Symbols\TypeUnification.cs (17)
30var substituted1 = SubstituteAllTypeParameters(substitution, TypeWithAnnotations.Create(t1)); 31var substituted2 = SubstituteAllTypeParameters(substitution, TypeWithAnnotations.Create(t2)); 41private static TypeWithAnnotations SubstituteAllTypeParameters(AbstractTypeMap? substitution, TypeWithAnnotations type) 45TypeWithAnnotations previous; 59return CanUnifyHelper(TypeWithAnnotations.Create(t1), TypeWithAnnotations.Create(t2), ref substitution); 79private static bool CanUnifyHelper(TypeWithAnnotations t1, TypeWithAnnotations t2, ref MutableTypeMap? substitution) 101TypeWithAnnotations tmp = t1; 207AddSubstitution(ref substitution, tp1, TypeWithAnnotations.Create(t2.Type)); 215TypeWithAnnotations.Create(t2.Type, 234TypeWithAnnotations.Create(t1.Type, 249private static void AddSubstitution(ref MutableTypeMap? substitution, TypeParameterSymbol tp1, TypeWithAnnotations t2) 280foreach (TypeWithAnnotations typePart in typeParts)
Symbols\TypeWithAnnotations.cs (84)
29internal readonly TypeWithAnnotations Value; 30internal Boxed(TypeWithAnnotations value) 72internal static TypeWithAnnotations Create(bool isNullableEnabled, TypeSymbol typeSymbol, bool isAnnotated = false) 82internal static TypeWithAnnotations Create(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation = NullableAnnotation.Oblivious, ImmutableArray<CustomModifier> customModifiers = default) 105internal TypeWithAnnotations AsAnnotated() 115internal TypeWithAnnotations AsNotAnnotated() 165private static TypeWithAnnotations CreateNonLazyType(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation, ImmutableArray<CustomModifier> customModifiers) 170private static TypeWithAnnotations CreateLazyNullableType(CSharpCompilation compilation, TypeWithAnnotations underlying) 186public TypeWithAnnotations SetIsAnnotated(CSharpCompilation compilation) 214TypeWithAnnotations makeNullableT() 227private TypeWithAnnotations AsNullableReferenceType() => _extensions.AsNullableReferenceType(this); 228public TypeWithAnnotations AsNotNullableReferenceType() => _extensions.AsNotNullableReferenceType(this); 233internal TypeWithAnnotations MergeEquivalentTypes(TypeWithAnnotations other, VarianceKind variance) 242public TypeWithAnnotations WithModifiers(ImmutableArray<CustomModifier> customModifiers) => 327public bool Equals(TypeWithAnnotations other, TypeCompareKind comparison) 379internal sealed class EqualsComparer : EqualityComparer<TypeWithAnnotations> 391public override int GetHashCode(TypeWithAnnotations obj) 400public override bool Equals(TypeWithAnnotations x, TypeWithAnnotations y) 410internal bool TypeSymbolEquals(TypeWithAnnotations other, TypeCompareKind comparison) => 425public TypeWithAnnotations SubstituteType(AbstractTypeMap typeMap) => 428internal TypeWithAnnotations SubstituteTypeCore(AbstractTypeMap typeMap) 435var newTypeWithModifiers = typeMap.SubstituteType(typeSymbol); 514private bool TypeSymbolEqualsCore(TypeWithAnnotations other, TypeCompareKind comparison) 539public TypeWithAnnotations WithTypeAndModifiers(TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) => 542public TypeWithAnnotations WithType(TypeSymbol typeSymbol) => 562TypeWithAnnotations typeWithAnnotationsOpt, 597private static void AddNullableTransforms(TypeWithAnnotations typeWithAnnotations, ArrayBuilder<byte> transforms) 633public bool ApplyNullableTransforms(byte defaultTransformFlag, ImmutableArray<byte> transforms, ref int position, out TypeWithAnnotations result) 696public TypeWithAnnotations WithTopLevelNonNullability() 707public TypeWithAnnotations SetUnknownNullabilityForReferenceTypes() 734return other is TypeWithAnnotations t && this.Equals(t, TypeCompareKind.ConsiderEverything); 752public static bool operator ==(TypeWithAnnotations? x, TypeWithAnnotations? y) 760public static bool operator !=(TypeWithAnnotations? x, TypeWithAnnotations? y) 766internal bool IsSameAs(TypeWithAnnotations other) 822internal static Extensions CreateLazy(CSharpCompilation compilation, TypeWithAnnotations underlying) 831internal abstract TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type); 832internal abstract TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type); 834internal abstract TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers); 847internal abstract TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers); 849internal abstract bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison); 850internal abstract TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap); 851internal abstract void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics); 879internal override TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers) 886internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) 891internal override TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type) 896internal override TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type) 902internal override bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison) 907internal override TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap) 912internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 929private readonly TypeWithAnnotations _underlying; 932public LazyNullableTypeParameter(CSharpCompilation compilation, TypeWithAnnotations underlying) 977internal override TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers) 987return TypeWithAnnotations.Create(resolvedType, type.NullableAnnotation, customModifiers: customModifiers); 993internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) 997return TypeWithAnnotations.Create(typeSymbol, type.NullableAnnotation, customModifiers: customModifiers); 1003internal override TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type) 1008internal override TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type) 1017internal override TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap) 1024var newUnderlying = _underlying.SubstituteTypeCore(typeMap); 1041internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1053internal override bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison)
Symbols\TypeWithState.cs (6)
40public static TypeWithState Create(TypeWithAnnotations typeWithAnnotations, FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None) 85public TypeWithAnnotations ToTypeWithAnnotations(CSharpCompilation compilation, bool asAnnotatedType = false) 89var type = TypeWithAnnotations.Create(Type, NullableAnnotation.NotAnnotated); 95return TypeWithAnnotations.Create(this.Type, annotation); 98public TypeWithAnnotations ToAnnotatedTypeWithAnnotations(CSharpCompilation compilation) =>
Symbols\UnboundGenericType.cs (3)
49public static ImmutableArray<TypeWithAnnotations> CreateTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters, int n, DiagnosticInfo errorInfo) 51var result = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 55result.Add(TypeWithAnnotations.Create(new UnboundArgumentErrorTypeSymbol(name, errorInfo)));
Symbols\UpdatedContainingSymbolLocal.cs (4)
18internal static UpdatedContainingSymbolAndNullableAnnotationLocal CreateForTest(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 23private UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType, bool assertContaining) 34internal UpdatedContainingSymbolAndNullableAnnotationLocal(SourceLocalSymbol underlyingLocal, Symbol updatedContainingSymbol, TypeWithAnnotations updatedType) 41public override TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\VarianceSafety.cs (1)
262foreach (TypeWithAnnotations constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics)
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
39public override TypeWithAnnotations TypeWithAnnotations
Utilities\TypeSymbolExtensions.cs (8)
57ImmutableArray<TypeWithAnnotations> typeArgs = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 59foreach (TypeWithAnnotations typeArg in typeArgs) 75static int customModifierCountForTypeWithAnnotations(TypeWithAnnotations typeWithAnnotations) 100TypeWithAnnotations elementType = array.ElementTypeWithAnnotations; 107TypeWithAnnotations pointedAtType = pointer.PointedAtTypeWithAnnotations; 138ImmutableArray<TypeWithAnnotations> typeArgs = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 140foreach (TypeWithAnnotations typeArg in typeArgs) 157static bool checkTypeWithAnnotations(TypeWithAnnotations typeWithAnnotations, bool flagNonDefaultArraySizesOrLowerBounds)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (31)
CodeGen\CodeGenDeconstructTests.cs (2)
5607var xType = xSymbol.GetSymbol<FieldSymbol>().TypeWithAnnotations; 6047IDiscardSymbol symbolClone = new DiscardSymbol(TypeWithAnnotations.Create(symbol.Type.GetSymbol())).GetPublicSymbol();
CodeGen\CodeGenFunctionPointersTests.cs (17)
868var returnTypeWithAnnotations = ((FunctionPointerTypeSymbol)m.ReturnType).Signature.ReturnTypeWithAnnotations; 7660CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7661returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7664CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7665parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7669CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string, customModifiers: ImmutableArray.Create(testMod)), refCustomModifiers: default, 7670parameterRefCustomModifiers: default, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7673CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: ImmutableArray.Create(testMod), 7674parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7745CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7746returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7749CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7750returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7754CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string, customModifiers: ImmutableArray.Create(testMod)), refCustomModifiers: default, 7755returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7758CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: ImmutableArray.Create(testMod), 7759returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
CodeGen\CodeGenTupleTest.cs (11)
951var partialParamType = partialNamesMethod.Parameters.Single().TypeWithAnnotations; 957var allNullParamType = allNullNamesMethod.Parameters.Single().TypeWithAnnotations; 13706Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 13762Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 13823Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 29027var obliviousObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Oblivious); 29044var nullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Annotated); 29045var nonNullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.NotAnnotated);
Emit\EmitMetadataTests.cs (1)
1167var type = property.TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (19)
Attributes\AttributeTests.cs (14)
5196var typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW)); 5201typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW), rank: 2); 5206typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW)); 5207typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2); 5212NamedTypeSymbol classYOfW = classY.ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(classW))); 5213typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classYOfW), rank: 2); 5214typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg)); 5219NamedTypeSymbol classYOfInt = classY.ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int32)))); 5221typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(substNestedF), rank: 3); 5222typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg)); 5223typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2); 5228NamedTypeSymbol substNestedZ = classYOfInt.GetTypeMember("Z").ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(classW))); 5229typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(substNestedZ)); 5230typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2);
Attributes\AttributeTests_NativeInteger.cs (1)
1062static TypeWithAnnotations getConstraintType(NamedTypeSymbol type) => type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0];
Attributes\AttributeTests_Nullable.cs (3)
4200private static void VerifyBytes(TypeWithAnnotations type, byte[] expectedPreviously, byte[] expectedNow, string expectedDisplay) 4209var underlyingType = type.SetUnknownNullabilityForReferenceTypes(); 4212TypeWithAnnotations updated;
Attributes\AttributeTests_Tuples.cs (1)
280foreach (var parameterType in methodSymbol.ParameterTypesWithAnnotations)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (44)
Binders\WithTypeArgumentsBinder.cs (4)
18private readonly ImmutableArray<TypeWithAnnotations> _typeArguments; 21internal WithTypeArgumentsBinder(ImmutableArray<TypeWithAnnotations> typeArguments, Binder next) 36foreach (var tps in _typeArguments) 50foreach (var parameter in _typeArguments)
CSharpEESymbolProvider.cs (1)
44type = new PointerTypeSymbol(TypeWithAnnotations.Create(info.Type));
CSharpInstructionDecoder.cs (1)
123ImmutableArray.CreateRange(typeArguments, 0, methodArgumentStartIndex, t => TypeWithAnnotations.Create(t)));
Rewriters\LocalDeclarationRewriter.cs (1)
140TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Byte)));
Symbols\DisplayClassVariable.cs (3)
113private readonly TypeWithAnnotations _type; 115internal EEDisplayClassFieldSymbol(NamedTypeSymbol container, string name, TypeWithAnnotations type) 214internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\EECompilationContextMethod.cs (2)
51public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 61public override TypeWithAnnotations ReturnTypeWithAnnotations => _underlyingMethod.ReturnTypeWithAnnotations;
Symbols\EEDisplayClassFieldLocalSymbol.cs (2)
55public override TypeWithAnnotations TypeWithAnnotations 57get { return TypeWithAnnotations.Create(_variable.Type); }
Symbols\EELocalConstantSymbol.cs (5)
17private readonly TypeWithAnnotations _type; 25: this(method, name, TypeWithAnnotations.Create(type), value) 32TypeWithAnnotations type, 43var type = typeMap.SubstituteType(_type); 67public override TypeWithAnnotations TypeWithAnnotations
Symbols\EELocalSymbol.cs (5)
18private readonly TypeWithAnnotations _type; 40: this(method, locations, nameOpt, ordinal, declarationKind, TypeWithAnnotations.Create(type), refKind, isPinned, isCompilerGenerated, canScheduleToStack) 50TypeWithAnnotations type, 75var type = typeMap.SubstituteType(_type); 119public override TypeWithAnnotations TypeWithAnnotations
Symbols\EELocalSymbolBase.cs (2)
25var type = typeMap.SubstituteType(local.TypeWithAnnotations); 80var type = this.TypeWithAnnotations;
Symbols\EEMethodSymbol.cs (4)
74private TypeWithAnnotations _lazyReturnType; 324public override TypeWithAnnotations ReturnTypeWithAnnotations 342public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 476_lazyReturnType = TypeWithAnnotations.Create(CalculateReturnType(compilation, body));
Symbols\EENamedTypeSymbol.cs (1)
130internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\EETypeParameterSymbol.cs (1)
141internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress)
Symbols\PlaceholderLocalSymbol.cs (3)
24private readonly TypeWithAnnotations _type; 32_type = TypeWithAnnotations.Create(type); 94public override TypeWithAnnotations TypeWithAnnotations
Symbols\PlaceholderMethodSymbol.cs (4)
28private readonly TypeWithAnnotations _returnType; 41_returnType = TypeWithAnnotations.Create(getReturnType(this)); 159public override TypeWithAnnotations ReturnTypeWithAnnotations 175public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations
Symbols\SimpleTypeParameterSymbol.cs (2)
114internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 116return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\SynthesizedContextMethodSymbol.cs (3)
130public override TypeWithAnnotations ReturnTypeWithAnnotations 144public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 146get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (1)
ExpressionCompilerTests.cs (1)
2155var returnType = method.ReturnTypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (119)
Semantics\DelegateTypeTests.cs (5)
12256var funcOfObjectNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(objectType, NullableAnnotation.Annotated))); 12257var funcOfStringNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.Annotated))); 12258var funcOfStringNotNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.NotAnnotated))); 12274var setNotNullable = (TypeWithAnnotations type) => TypeWithAnnotations.Create(type.Type, NullableAnnotation.NotAnnotated);
Semantics\InterpolationTests.cs (1)
7575var substitutedC = c.WithTypeArguments(ImmutableArray.Create(TypeWithAnnotations.Create(handler)));
Semantics\NativeIntegerTests.cs (3)
591void verifyTypes(TypeWithAnnotations fromMember, TypeWithAnnotations fromUnderlyingMember) 603bool containsType(TypeWithAnnotations type, bool useNativeInteger)
Semantics\NullableReferenceTypesTests.cs (98)
8796TypeWithAnnotations getParameterType(CSharpCompilation c) => c.GetMember<MethodSymbol>("A.F").Parameters[0].TypeWithAnnotations; 8966void verifyTuple(TypeWithAnnotations type) 9009var constraintType = baseType.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 9035var typeArg = interfaceType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 10341var typeArg = ((NamedTypeSymbol)method.ReturnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 11189var type = method.ReturnTypeWithAnnotations; 11292var type = method.ReturnTypeWithAnnotations; 13196Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 13314var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13322var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13401var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13676Assert.False(m1.Parameters[0].TypeWithAnnotations.Equals(m1.OverriddenMethod.ConstructIfGeneric(m1.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14016Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14021Assert.True(m3.ReturnTypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14123Assert.False(member.Parameters[0].TypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14128Assert.True(m3.Parameters[0].TypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 16473var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 16481var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17694var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17702var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17762var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17770var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17838var m1Def = m1.ConstructIfGeneric(m1Impl.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 33047Assert.Equal(expectedType, symbol.TypeWithAnnotations.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 33065Assert.Equal(expectedType, symbol.TypeWithAnnotations.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 56875var type = symbol.TypeWithAnnotations; 108877var constraintType = type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0]; 108966var constraintType = type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0]; 109385m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Annotated))), 109386m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.NotAnnotated))), 109387m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Oblivious))) 109392m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Annotated))), 109393m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.NotAnnotated))), 109394m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Oblivious))) 112067var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 112079var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 112109var i1 = iDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 112118var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 112130var i2b = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 112135var i2c = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i2.TypeParameters.Single(), NullableAnnotation.Annotated))); 112139var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 112144var i3b = i3.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i3.TypeParameters.Single(), NullableAnnotation.Annotated))); 112150var c4 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), customModifiers: modifiers))); 141097Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141137Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141177Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141216Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141254Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141287Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141320Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141357Assert.Equal("Extension<object>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141396Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141485Assert.Equal(new[] { "I<object>", "I<object!>" }, interfaces.Select(i => i.ToDisplayString(TypeWithAnnotations.TestDisplayFormat))); 141666Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141697Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141730Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145606var parameterType = method.Parameters[0].TypeWithAnnotations; 153515i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153517i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153549i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153551i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153587i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153589i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153615i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153617i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153647i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153649i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153655Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153658Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153691Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153786Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153816i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153818i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153824Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153827Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153857i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153859i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153867Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153897i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153899i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 153908Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153943Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153976Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154071Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154077Assert.Equal("object", ((IMethodSymbol)found).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154111i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154113i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154119Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154153i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154155i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154163Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154200Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154234i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154236i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154266i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154268i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154300i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 154302i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat));
Semantics\OperatorTests.cs (2)
3271private static string FormatTypeArgumentList(ImmutableArray<TypeWithAnnotations>? arguments) 3298let typeArguments = node["typeArgumentsOpt"].Value as ImmutableArray<TypeWithAnnotations>?
Semantics\RawInterpolationTests_Handler.cs (1)
5894var substitutedC = c.WithTypeArguments(ImmutableArray.Create(TypeWithAnnotations.Create(handler)));
Semantics\RecordTests.cs (2)
12496var returnType = method.ReturnTypeWithAnnotations; 12503var parameterType = method.Parameters[0].TypeWithAnnotations;
Semantics\UnsafeTests.cs (7)
5015var structPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(structType)); 5328var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 5395var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 5453var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 7382var charPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(charSymbol)); 7454var charPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(charSymbol)); 7456var voidPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(voidSymbol));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (74)
DeclarationTests.cs (2)
308var returnType = method.ReturnTypeWithAnnotations; 351var returnType = method.ReturnTypeWithAnnotations;
SymbolDisplay\SymbolDisplayTests.cs (1)
6120var type = method.GetSymbol<MethodSymbol>().ReturnTypeWithAnnotations;
Symbols\CompilationCreationTests.cs (1)
96var arrayOfc107 = ArrayTypeSymbol.CreateCSharpArray(c1.Assembly, TypeWithAnnotations.Create(c107));
Symbols\CorLibrary\CorTypes.cs (1)
42var p = noMsCorLibRef.GlobalNamespace.GetTypeMembers("I1").Single().
Symbols\CustomModifiersTests.cs (2)
2482var t1 = test1.Parameters[0].TypeWithAnnotations; 2483var t2 = test2.Parameters[0].TypeWithAnnotations;
Symbols\ExtensionMethodTests.cs (6)
2534var arrayType = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(stringType), 1); 2539ImmutableArray.Create<TypeWithAnnotations>(), 2548ImmutableArray.Create(TypeWithAnnotations.Create(intType)), 2557ImmutableArray.Create(TypeWithAnnotations.Create(intType), TypeWithAnnotations.Create(arrayType)), 2569ImmutableArray<TypeWithAnnotations> typeArgs,
Symbols\FunctionPointerTypeSymbolTests.cs (14)
909var ret1 = p1.Signature.ReturnTypeWithAnnotations; 910var ret2 = p2.Signature.ReturnTypeWithAnnotations; 2048TypeWithAnnotations.Create(returnType, customModifiers: customModifiers), 2051parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2057TypeWithAnnotations.Create(returnType), 2060parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2115TypeWithAnnotations.Create(returnType, customModifiers: customModifiers), 2118parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2124TypeWithAnnotations.Create(returnType), 2127parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2174TypeWithAnnotations.Create(returnType, customModifiers: typeCustomModifiers), 2177parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2183TypeWithAnnotations.Create(returnType, customModifiers: typeCustomModifiers), 2186parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty,
Symbols\InterfaceImplementationTests.cs (1)
1863var returnType = derived.GetMember<MethodSymbol>(WellKnownMemberNames.DestructorName).ReturnTypeWithAnnotations;
Symbols\Metadata\PE\DynamicTransformsTests.cs (23)
76var arrayOfT = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(t)); 80var arrayOfInnerInnerOfInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(memberInnerInnerOfInt)); 135var arrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(s_dynamicType), 1); 140var arrayOfArrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(arrayOfDynamic), 1); 222var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 233complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 234var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1); 240var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(derivedTypeParam), 1); 246complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 252complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 253complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1); 280var arrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(s_dynamicType)); 286var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(derivedTypeParam)); 294var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner)); 300complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner)); 301var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray)); 334var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(unsafeClassTypeParam), 1); 340var pointerToInt = new PointerTypeSymbol(TypeWithAnnotations.Create(_intType)); 341var arrayOfPointerToInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(pointerToInt), 1); 343var arrayOfArrayOfPointerToInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(arrayOfPointerToInt), 1); 347var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 353complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 354var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1);
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (1)
271var missing = methodSymbol.TypeWithAnnotations;
Symbols\MockNamedTypeSymbol.cs (2)
57internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 61return ImmutableArray.Create<TypeWithAnnotations>();
Symbols\MockSymbolTests.cs (4)
28ArrayTypeSymbol ats1 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 1); 37ArrayTypeSymbol ats2 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 2); 45ArrayTypeSymbol ats3 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 3); 55PointerTypeSymbol pts1 = new PointerTypeSymbol(TypeWithAnnotations.Create(pointedAtType));
Symbols\Retargeting\RetargetingTests.cs (2)
1153public void CheckSymbols(TypeWithAnnotations a, TypeWithAnnotations b, bool recurse)
Symbols\Source\CompletionTests.cs (3)
44var xType = x.TypeWithAnnotations; 52var yType = y.TypeWithAnnotations; 83var pType = p.TypeWithAnnotations;
Symbols\Source\ModifierTests.cs (3)
158var pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(typeParamType, customModifiers: customModifiers)); // NOTE: We're constructing this manually, since it's illegal. 159var arrayType = ArrayTypeSymbol.CreateCSharpArray(comp.Assembly, TypeWithAnnotations.Create(typeParamType, customModifiers: customModifiers)); // This is legal, but we're already manually constructing types. 161var typeMap = new TypeMap(ImmutableArray.Create(typeParamType), ImmutableArray.Create(TypeWithAnnotations.Create(intType)));
Symbols\Source\TypeMapTests.cs (2)
97return new TypeMap(allTypeParameters.ToImmutableAndFree(), typeArguments.SelectAsArray(t => TypeWithAnnotations.Create(t))).SubstituteNamedType(type); 156var type = v1.TypeWithAnnotations;
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (3)
43var wrappedLocal1 = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.Annotated)); 44var wrappedLocal1a = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.Annotated)); 45var wrappedLocal2 = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local2, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.NotAnnotated));
Symbols\SymbolErrorTests.cs (2)
3359var ptype = param.TypeWithAnnotations; 16800var fieldType = fieldSym.TypeWithAnnotations;
Symbols\TypeTests.cs (1)
472var elemType1 = (field1 as FieldSymbol).TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\DiagnosticTest.cs (2)
113var type = TypeWithAnnotations.Create(comp.GetSpecialType(SpecialType.System_Object));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
CompilationTestUtils.cs (2)
476var type = TypeWithState.Create( 479return type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat);
SymbolUtilities.cs (2)
105public static string ToTestDisplayString(this TypeWithAnnotations type, bool includeNonNullable = false) 111public static string[] ToTestDisplayStrings(this IEnumerable<TypeWithAnnotations> types)
UsesIsNullableVisitor.cs (3)
131private bool AddIfUsesIsNullable(Symbol symbol, TypeWithAnnotations type, ConsList<TypeParameterSymbol> inProgress) 151private bool UsesIsNullable(TypeWithAnnotations type, ConsList<TypeParameterSymbol> inProgress) 211private bool UsesIsNullable(ImmutableArray<TypeWithAnnotations> types, ConsList<TypeParameterSymbol> inProgress)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdEventTests.cs (1)
3573var eventType = @event.TypeWithAnnotations;
Metadata\WinMdMetadataTests.cs (1)
96var ret = func.ReturnTypeWithAnnotations;