3 instantiations of TypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (3)
Symbols\TypeWithAnnotations.cs (3)
170return new TypeWithAnnotations(typeSymbol, nullableAnnotation, Extensions.Create(customModifiers)); 175return new TypeWithAnnotations(defaultType: underlying.DefaultType, defaultAnnotation: NullableAnnotation.Annotated, new LazyNullableTypeParameter(compilation, underlying)); 180return new TypeWithAnnotations(defaultType: substitutedTypeSymbol, defaultAnnotation: NullableAnnotation.Ignored, new LazySubstitutedType(customModifiers, typeParameter));
2146 references to TypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (2128)
Binder\Binder.cs (1)
378internal 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) 55public override TypeWithAnnotations ParameterTypeWithAnnotations(int index) { throw new ArgumentException(); } // implicitly typed
Binder\Binder.ValueChecks.cs (7)
2999public override TypeWithAnnotations TypeWithAnnotations 3000=> TypeWithAnnotations.Create(_type, NullableAnnotation.NotAnnotated); 4524var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(_compilation, expr.Type, out var elementType); 5476TypeWithAnnotations.Create(elementAccess.Expression.Type), 5485returnType: TypeWithAnnotations.Create(elementAccess.Type), 5516TypeWithAnnotations.Create(inlineArray.Type), 5525returnType: TypeWithAnnotations.Create(resultType),
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); 400var paramType = parameter.TypeWithAnnotations;
Binder\Binder_Await.cs (1)
372var 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); 347return (TypeParameterConstraintClause.Create(constraints, constraintTypes?.ToImmutableAndFree() ?? ImmutableArray<TypeWithAnnotations>.Empty), syntaxBuilder); 412var constraintTypeBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 417var constraintType = constraintTypes[i]; 448TypeWithAnnotations constraintType, 485TypeWithAnnotations type, 487ArrayBuilder<TypeWithAnnotations> constraintTypes, 553static bool isValidConstraintType(TypeParameterSymbol typeParameter, TypeConstraintSyntax syntax, TypeWithAnnotations typeWithAnnotations, bool performOnlyCycleSafeValidation, BindingDiagnosticBag diagnostics)
Binder\Binder_Conversions.cs (10)
370ImmutableArray<TypeWithAnnotations> sourceTypes; 371ImmutableArray<TypeWithAnnotations> destTypes; 1043result = TryGetCollectionIterationType(syntax, targetTypeOriginalDefinition, out TypeWithAnnotations elementTypeOriginalDefinition); 1303typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>), 1497parameterTypes: out ImmutableArray<TypeWithAnnotations> parameterTypes, 1690internal bool TryGetCollectionIterationType(SyntaxNode syntax, TypeSymbol collectionType, out TypeWithAnnotations iterationType) 1747var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations); 1867var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2409stackAllocType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 2486var 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); 945parameterBuilder.Add(new SignatureOnlyParameterSymbol(TypeWithAnnotations.Create(type), ImmutableArray<CustomModifier>.Empty, isParamsArray: false, isParamsCollection: 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 (49)
368var type = new PointerTypeSymbol(TypeWithAnnotations.Create(boundStackAlloc.ElementType)); 931var declType = BindVariableTypeWithAnnotations(node.Designation, diagnostics, node.Type.SkipScoped(out _).SkipRef(), ref isConst, out isVar, out alias); 939private BoundExpression BindDeclarationVariablesForErrorRecovery(TypeWithAnnotations declTypeWithAnnotations, VariableDesignationSyntax node, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics) 941declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 980subExpressions.SelectAsArray(e => TypeWithAnnotations.Create(e.Type)), 1015var elementTypesWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arguments.Count); 1047var elementTypeWithAnnotations = TypeWithAnnotations.Create(boundArgument.Type); 1232TypeWithAnnotations typeWithAnnotations = BindType(node.Type, diagnostics); 1373TypeWithAnnotations typeWithAnnotations = typeofBinder.BindType(typeSyntax, diagnostics, out alias); 1397private void CheckDisallowedAttributeDependentType(TypeWithAnnotations typeArgument, NameSyntax attributeName, BindingDiagnosticBag diagnostics) 1426TypeWithAnnotations typeWithAnnotations = this.BindType(typeSyntax, diagnostics, out alias); 1535TypeWithAnnotations typeWithAnnotations = this.BindType(node.Type, diagnostics, out AliasSymbol alias); 1592default(ImmutableArray<TypeWithAnnotations>); 2540TypeWithAnnotations targetTypeWithAnnotations = this.BindType(node.Type, diagnostics); 2701private BoundExpression BindCastCore(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, bool wasCompilerGenerated, BindingDiagnosticBag diagnostics) 2789var targetElementTypesWithAnnotations = default(ImmutableArray<TypeWithAnnotations>); 2849ImmutableArray<TypeWithAnnotations> targetElementTypesWithAnnotations) 2880private BoundExpression BindExplicitNullableCastFromNonNullable(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, BindingDiagnosticBag diagnostics) 2888TypeWithAnnotations underlyingTargetTypeWithAnnotations = targetTypeWithAnnotations.Type.GetNullableUnderlyingTypeWithAnnotations(); 3131var declType = BindVariableTypeWithAnnotations(designation, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 3178var declType = BindVariableTypeWithAnnotations(declarationExpression, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 3509TypeWithAnnotations parameterTypeWithAnnotations, 3609TypeWithAnnotations paramsElementTypeOpt = result.ParamsElementTypeOpt; 3666void reportUnsafeIfNeeded(MemberResolutionResult<TMember> methodResult, BindingDiagnosticBag diagnostics, BoundExpression argument, TypeWithAnnotations parameterTypeWithAnnotations) 4087var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank); 4116type: GetStackAllocType(node, TypeWithAnnotations.Create(bestType), diagnostics, out bool hasErrors), 4462var elementType = arrayType.ElementTypeWithAnnotations; 4547private TypeSymbol GetStackAllocType(SyntaxNode node, TypeWithAnnotations elementTypeWithAnnotations, BindingDiagnosticBag diagnostics, out bool hasErrors) 5047typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty, 5142var typeWithAnnotations = BindType(node.Type, diagnostics); 6654var finalApplicableCandidates = GetCandidatesPassingFinalValidation(node, overloadResolutionResult, receiverOpt: null, default(ImmutableArray<TypeWithAnnotations>), invokedAsExtensionMethod: false, diagnostics); 7544ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations = rightHasTypeArguments ? 7546default(ImmutableArray<TypeWithAnnotations>); 7561var typeArgument = typeArgumentsWithAnnotations[i]; 7589/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, TypeSyntax, TypeWithAnnotations, BindingDiagnosticBag, string)"/>. 7664var typeArguments = typeArgumentsSyntax.Count > 0 ? BindTypeArguments(typeArgumentsSyntax, diagnostics) : default(ImmutableArray<TypeWithAnnotations>); 7760ImmutableArray<TypeWithAnnotations> typeArguments, 7834ImmutableArray<TypeWithAnnotations> typeArguments, 7930ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8146default(ImmutableArray<TypeWithAnnotations>), 8228ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8305typeWithAnnotations: TypeWithAnnotations.Create(type)); 8344ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8465ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 9763var finalApplicableCandidates = GetCandidatesPassingFinalValidation(syntax, overloadResolutionResult, receiver, default(ImmutableArray<TypeWithAnnotations>), invokedAsExtensionMethod: false, diagnostics); 10799TypeWithAnnotations? returnTypeOverride = null) 10804var returnType = returnTypeOverride ?? methodSymbol.ReturnTypeWithAnnotations; 10884static bool checkConstraints(CSharpCompilation compilation, ConversionsBase conversions, NamedTypeSymbol delegateType, ImmutableArray<TypeWithAnnotations> typeArguments)
Binder\Binder_InterpolatedString.cs (1)
348typeArgs: default(ImmutableArray<TypeWithAnnotations>),
Binder\Binder_Invocation.cs (7)
84ImmutableArray<TypeWithAnnotations> typeArgs = default(ImmutableArray<TypeWithAnnotations>), 726ImmutableArray<TypeWithAnnotations> typeArguments; 974ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 1918ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 2068newArguments[i] = ((OutVariablePendingInference)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType), null); 2079newArguments[i] = ((BoundDiscardExpression)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType));
Binder\Binder_Lambda.cs (6)
47ImmutableArray<TypeWithAnnotations> types = default; 50TypeWithAnnotations returnType = default; 122var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 169TypeWithAnnotations type = default; 280private (RefKind, TypeWithAnnotations) BindExplicitLambdaReturnType(TypeSyntax syntax, BindingDiagnosticBag diagnostics) 291var returnType = BindType(syntax, diagnostics);
Binder\Binder_Operators.cs (4)
2553TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(operandType)); 3260var targetTypeWithAnnotations = typeExpression.TypeWithAnnotations; 3340TypeWithAnnotations targetTypeWithAnnotations = BindType(possibleType, bindAsTypeDiagnostics, out AliasSymbol alias); 3692TypeWithAnnotations targetTypeWithAnnotations = BindType(node.Right, diagnostics, out alias);
Binder\Binder_Patterns.cs (12)
332declType: TypeWithAnnotations.Create(narrowedType, NullableAnnotation.NotAnnotated), 858TypeWithAnnotations declType = BindType(typeSyntax, diagnostics, out AliasSymbol aliasOpt); 867TypeWithAnnotations declType, 926private TypeWithAnnotations BindRecursivePatternType( 942return TypeWithAnnotations.Create(inputType.StrippedType(), NullableAnnotation.NotAnnotated); 973TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 988positionalClause, declType, ImmutableArray<TypeWithAnnotations>.Empty, permitDesignations, ref hasErrors, patternsBuilder, diagnostics); 1156ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 1357var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation); 1384addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations>.Empty); 1433void addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations> elementTypes) 1556typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>),
Binder\Binder_Query.cs (8)
56var typeRestriction = BindTypeArgument(fromClause.Type, diagnostics); 397var castType = BindTypeArgument(join.Type, diagnostics); 818new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None); 842private UnboundLambda MakeQueryUnboundLambdaWithCast(RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression, TypeSyntax castTypeSyntax, TypeWithAnnotations castType, bool withDependencies) 880return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), ImmutableArray.Create(arg), diagnostics 893return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), args, diagnostics 900protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics 913protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
Binder\Binder_Statements.cs (13)
725TypeWithAnnotations declType = BindVariableTypeWithAnnotations(node.Declaration, diagnostics, typeSyntax, ref isConst, isVar: out isVar, alias: out alias); 784private TypeWithAnnotations BindVariableTypeWithAnnotations(CSharpSyntaxNode declarationNode, BindingDiagnosticBag diagnostics, TypeSyntax typeSyntax, ref bool isConst, out bool isVar, out AliasSymbol alias) 797TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax.SkipScoped(out _).SkipRef(), diagnostics, out isVar, out alias); 952TypeWithAnnotations declTypeOpt, 978TypeWithAnnotations declTypeOpt, 1023declTypeOpt = TypeWithAnnotations.Create(initializerType); 1028declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1043declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1365TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 1470return op1.SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(inferredType)); 2334var targetElementTypes = default(ImmutableArray<TypeWithAnnotations>); 2508ImmutableArray<TypeWithAnnotations> targetElementTypes) 2821TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias);
Binder\Binder_Symbols.cs (36)
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) 302internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null, bool suppressUseSiteDiagnostics = false) 311internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, out AliasSymbol alias, ConsList<TypeSymbol> basesBeingResolved = null) 341return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(GetContainingNamespaceOrType(symbol.Symbol), symbol.Symbol, LookupResultKind.NotATypeOrNamespace, diagnosticInfo)); 401/// stack frames due to their use of large struct like <see cref="TypeWithAnnotations"/>. 459return TypeWithAnnotations.Create( 475return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(tupleTypeSyntax.CloseParenToken), BindTupleType(tupleTypeSyntax, diagnostics, basesBeingResolved)); 521void reportNullableReferenceTypesIfNeeded(SyntaxToken questionToken, TypeWithAnnotations typeArgument = default) 543TypeWithAnnotations typeArgument = BindType(typeArgumentSyntax, diagnostics, basesBeingResolved); 544TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation); 571return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(predefinedType.Keyword), type); 584return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(left, LookupResultKind.NotATypeOrNamespace, diagnostics.Add(ErrorCode.ERR_ColColWithTypeAlias, node.Alias.Location, node.Alias.Identifier.Text))); 593var elementType = BindType(node.ElementType, diagnostics, basesBeingResolved); 601return TypeWithAnnotations.Create(new PointerTypeSymbol(elementType)); 607return TypeWithAnnotations.Create(CreateErrorType()); 611internal static CSDiagnosticInfo? GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(LanguageVersion languageVersion, in TypeWithAnnotations type) 627private TypeWithAnnotations BindArrayType( 634TypeWithAnnotations type = BindType(node.ElementType, diagnostics, basesBeingResolved); 670type = TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(rankSpecifier.CloseBracketToken), array); 681var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(numElements); 693var argumentType = BindType(argumentSyntax.Type, diagnostics, basesBeingResolved); 834return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null)); 860return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol( 868return TypeWithAnnotations.Create(errorResult); 1150private TypeWithAnnotations BindGenericSimpleNamespaceOrTypeOrAliasSymbol( 1256return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(node.TypeArgumentList.GreaterThanToken), resultType); 1337private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1340var args = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Count); 1349private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1363? TypeWithAnnotations.Create(UnboundArgumentErrorTypeSymbol.Instance) 1372private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1418ImmutableArray<TypeWithAnnotations> typeArguments, 1572ImmutableArray<TypeWithAnnotations> typeArguments, 1641TypeWithAnnotations 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)
556ImmutableArray<TypeWithAnnotations> elementTypes = inputType.TupleElementTypesWithAnnotations;
Binder\ExecutableCodeBinder.cs (1)
137TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, refKind, returnType, errorLocation, diagnostics);
Binder\ForEachEnumeratorInfo.cs (3)
24public readonly TypeWithAnnotations ElementTypeWithAnnotations; 55TypeWithAnnotations elementType, 101public TypeWithAnnotations ElementTypeWithAnnotations;
Binder\ForEachLoopBinder.cs (15)
194TypeWithAnnotations inferredType; 227TypeWithAnnotations inferredType; 265TypeWithAnnotations iterationVariableType; 299TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias); 303declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 370iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 608internal TypeWithAnnotations InferCollectionElementType(BindingDiagnosticBag diagnostics, ExpressionSyntax collectionSyntax) 613GetEnumeratorInfoAndInferCollectionElementType(_syntax, collectionSyntax, ref collectionExpr, isAsync: IsAsync, isSpread: false, diagnostics, out TypeWithAnnotations inferredType, builder: out _); 666out TypeWithAnnotations inferredType, 680inferredType = TypeWithAnnotations.Create(DynamicTypeSymbol.Instance); 688inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax)); 1163builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax)); 1285builder.ElementTypeWithAnnotations = TypeWithAnnotations.Create( 1293TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, syntax)) : 1422var 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 (1)
16public static NullableAnnotation GetNullableAnnotation(ArrayBuilder<TypeWithAnnotations> types)
Binder\Semantics\Conversions\Conversions.cs (3)
163var collectionTypeKind = GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations); 418TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Object), customModifiers: parameter.TypeWithAnnotations.CustomModifiers), parameter.RefCustomModifiers, 491var sourceAsPointer = new PointerTypeSymbol(TypeWithAnnotations.Create(sourceExpression.ElementType));
Binder\Semantics\Conversions\ConversionsBase.cs (43)
1485if (anonymousFunction.HasExplicitReturnType(out var refKind, out var returnType)) 1656internal static CollectionExpressionTypeKind GetCollectionExpressionTypeKind(CSharpCompilation compilation, TypeSymbol destination, out TypeWithAnnotations elementType) 1708internal static bool IsSpanOrListType(CSharpCompilation compilation, TypeSymbol targetType, WellKnownType spanType, [NotNullWhen(true)] out TypeWithAnnotations elementType) 1828internal bool HasTopLevelNullabilityIdentityConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1860internal bool HasTopLevelNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1880private static bool IsPossiblyNullableTypeTypeParameter(in TypeWithAnnotations typeWithAnnotations) 1891public bool HasAnyNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1961(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 1978(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2281private delegate Conversion ClassifyConversionFromExpressionDelegate(ConversionsBase conversions, BoundExpression sourceExpression, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2282private delegate Conversion ClassifyConversionFromTypeDelegate(ConversionsBase conversions, TypeWithAnnotations source, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2296(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) 2314(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2367(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2386(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2407ImmutableArray<TypeWithAnnotations> sourceTypes; 2408ImmutableArray<TypeWithAnnotations> destTypes; 2592TypeWithAnnotations elementType = source.ElementTypeWithAnnotations; 2593TypeWithAnnotations argument0 = destinationAgg.TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo); 2603private bool HasImplicitReferenceConversion(TypeWithAnnotations source, TypeWithAnnotations destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3162var typeParameters = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3163var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3164var destinationTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3415bool hasConversion(RefKind refKind, TypeWithAnnotations sourceType, TypeWithAnnotations destinationType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3966var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3973var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3983var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3984var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3993var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 4000bool hasCovariantConversion(TypeWithAnnotations source, TypeWithAnnotations destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 4006bool hasIdentityConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 4029var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0];
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
582var voidPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(Compilation.GetSpecialType(SpecialType.System_Void)));
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (8)
108public readonly TypeWithAnnotations DefinitionParamsElementTypeOpt; 109public readonly TypeWithAnnotations ParamsElementTypeOpt; 125TypeWithAnnotations definitionParamsElementTypeOpt = default, 126TypeWithAnnotations paramsElementTypeOpt = default) 321public static MemberAnalysisResult BadArgumentConversions(ImmutableArray<int> argsToParamsOpt, BitVector badArguments, ImmutableArray<Conversion> conversions, TypeWithAnnotations definitionParamsElementTypeOpt, TypeWithAnnotations paramsElementTypeOpt) 381public static MemberAnalysisResult ExpandedForm(ImmutableArray<int> argsToParamsOpt, ImmutableArray<Conversion> conversions, bool hasAnyRefOmittedArgument, TypeWithAnnotations definitionParamsElementType, TypeWithAnnotations paramsElementType)
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 (164)
73public readonly ImmutableArray<TypeWithAnnotations> InferredTypeArguments; 82ImmutableArray<TypeWithAnnotations> inferredTypeArguments, 97internal abstract TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr); 99internal abstract TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method); 103internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 105return TypeWithAnnotations.Create(expr.GetTypeOrFunctionType()); 108internal override TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method) 136private readonly ImmutableArray<TypeWithAnnotations> _formalParameterTypes; 141private readonly (TypeWithAnnotations Type, bool FromFunctionType)[] _fixedResults; 142private readonly HashSet<TypeWithAnnotations>[] _exactBounds; 143private readonly HashSet<TypeWithAnnotations>[] _upperBounds; 144private readonly HashSet<TypeWithAnnotations>[] _lowerBounds; 174ImmutableArray<TypeWithAnnotations> formalParameterTypes, 319ImmutableArray<TypeWithAnnotations> formalParameterTypes, 332_fixedResults = new (TypeWithAnnotations, bool)[methodTypeParameters.Length]; 333_exactBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 334_upperBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 335_lowerBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 401var fixedType = _fixedResults[i].Type; 429private ImmutableArray<TypeWithAnnotations> GetResults(out bool inferredFromFunctionType) 449var fixedResultType = _fixedResults[i].Type; 467_fixedResults[i] = (TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(_constructedContainingTypeOfMethod, _methodTypeParameters[i].Name, 0, null, false)), false); 484private bool IsUnfixedTypeParameter(TypeWithAnnotations type) 509private void AddBound(TypeWithAnnotations addedBound, HashSet<TypeWithAnnotations>[] collectedBounds, TypeWithAnnotations methodTypeParameterWithAnnotations) 518collectedBounds[methodTypeParameterIndex] = new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer); 544static (typeParameter, i, self) => self.IsUnfixed(i) ? TypeWithAnnotations.Create(typeParameter) : self._fixedResults[i].Type, 586TypeWithAnnotations target = _formalParameterTypes[arg]; 594private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 622var argumentType = _extensions.GetTypeWithAnnotations(argument); 638TypeWithAnnotations target, 654if (!binder.TryGetCollectionIterationType((ExpressionSyntax)argument.Syntax, targetType.StrippedType(), out TypeWithAnnotations targetElementType)) 674TypeWithAnnotations target, 693private bool MakeExplicitParameterTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 725var destType = destTypes[i]; 843var formalType = _formalParameterTypes[arg]; 849private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 872private void MakeOutputTypeInferences(Binder binder, BoundUnconvertedCollectionExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 879if (!binder.TryGetCollectionIterationType((ExpressionSyntax)argument.Syntax, formalType.Type, out TypeWithAnnotations targetElementType)) 893private void MakeOutputTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 918var destType = destTypes[i]; 1341private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1366var sourceType = _extensions.GetTypeWithAnnotations(expression); 1374private bool InferredReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1392var returnType = delegateType.DelegateInvokeMethod.ReturnTypeWithAnnotations; 1398var inferredReturnType = InferReturnType(source, delegateType, ref useSiteInfo); 1447TypeWithAnnotations sourceReturnType = method.ReturnTypeWithAnnotations; 1466var returnType = MethodGroupReturnType(binder, originalMethodGroup, fixedParameters, method.RefKind, isFunctionPointerResolution, ref useSiteInfo, in callingConventionInfo); 1476private TypeWithAnnotations MethodGroupReturnType( 1495TypeWithAnnotations type = default; 1517private void ExplicitParameterTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1572private void ExplicitReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1589if (!anonymousFunction.HasExplicitReturnType(out _, out TypeWithAnnotations anonymousFunctionReturnType)) 1608private void ExactInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1662private bool ExactTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 1677private bool ExactArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1727var sourceElementType = GetSpanOrSZArrayElementType(source); 1728var targetElementType = GetSpanElementType(target); 1736private static TypeWithAnnotations GetSpanElementType(TypeSymbol type) 1742private static TypeWithAnnotations GetSpanOrSZArrayElementType(TypeSymbol type) 1756private void ExactOrBoundsInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1772private bool ExactOrBoundsNullableInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1792static bool isNullableOnly(TypeWithAnnotations type) 1796private bool ExactNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1801private bool LowerBoundTupleInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1810ImmutableArray<TypeWithAnnotations> sourceTypes; 1811ImmutableArray<TypeWithAnnotations> targetTypes; 1828private bool ExactConstructedInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1858private bool ExactPointerInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1918var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1919var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1939private void LowerBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2033private bool LowerBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 2048private static TypeWithAnnotations GetMatchingElementType(ArrayTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2102var elementSource = arraySource.ElementTypeWithAnnotations; 2103var elementTarget = GetMatchingElementType(arraySource, target, ref useSiteInfo); 2139var sourceElementType = GetSpanOrSZArrayElementType(source); 2140var targetElementType = GetSpanElementType(target); 2159private bool LowerBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2361var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2362var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2448private void UpperBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2509private bool UpperBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 2523private bool UpperBoundArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2541var elementTarget = arrayTarget.ElementTypeWithAnnotations; 2542var elementSource = GetMatchingElementType(arrayTarget, source.Type, ref useSiteInfo); 2560private bool UpperBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2565private bool UpperBoundConstructedInference(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations targetWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2711var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2712var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2830private static (TypeWithAnnotations Type, bool FromFunctionType) Fix( 2834HashSet<TypeWithAnnotations>? exact, 2835HashSet<TypeWithAnnotations>? lower, 2836HashSet<TypeWithAnnotations>? upper, 2851var candidates = new Dictionary<TypeWithAnnotations, TypeWithAnnotations>(EqualsIgnoringDynamicTupleNamesAndNullabilityComparer.Instance); 2856Predicate<TypeWithAnnotations> lowerPredicate; 2901var initialCandidates = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2926TypeWithAnnotations best = default; 2967best = TypeWithAnnotations.Create(resultType, best.NullableAnnotation); 2973static bool containsFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 2978static bool containsNonFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 2983static bool isFunctionType(TypeWithAnnotations type, [NotNullWhen(true)] out FunctionTypeSymbol? functionType) 3009private static bool ImplicitConversionExists(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations destinationWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConversionsBase conversions) 3033private TypeWithAnnotations InferReturnType(BoundExpression source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3114var returnType = anonymousFunction.InferReturnType(_conversions, fixedDelegate, ref useSiteInfo, out bool inferredFromFunctionType); 3173public static ImmutableArray<TypeWithAnnotations> InferTypeArgumentsFromFirstArgument( 3237var dest = _formalParameterTypes[0]; 3269private ImmutableArray<TypeWithAnnotations> GetInferredTypeArguments(out bool inferredFromFunctionType) 3271var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_fixedResults.Length); 3291private static void GetAllCandidates(Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, ArrayBuilder<TypeWithAnnotations> builder) 3304Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3305HashSet<TypeWithAnnotations> bounds, 3306Predicate<TypeWithAnnotations>? predicate, 3310foreach (var candidate in bounds) 3317var type = candidate; 3333Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3334TypeWithAnnotations newCandidate, 3337if (candidates.TryGetValue(newCandidate, out TypeWithAnnotations oldCandidate)) 3348Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3349HashSet<TypeWithAnnotations> bounds, 3350Predicate<TypeWithAnnotations>? predicate, 3351ArrayBuilder<TypeWithAnnotations> initialCandidates, 3360foreach (var bound in bounds) 3373TypeWithAnnotations source; 3374TypeWithAnnotations destination; 3388if (conversions.IncludeNullability && candidates.TryGetValue(bound, out var oldBound)) 3395var newBound = TypeWithAnnotations.Create(oldBound.Type, newAnnotation); 3415Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3416TypeWithAnnotations oldCandidate, 3417TypeWithAnnotations newCandidate, 3426if (candidates.TryGetValue(oldCandidate, out TypeWithAnnotations latest)) 3437TypeWithAnnotations merged = latest.MergeEquivalentTypes(newCandidate, variance); 3446private sealed class EqualsIgnoringDynamicTupleNamesAndNullabilityComparer : EqualityComparer<TypeWithAnnotations> 3450public override int GetHashCode(TypeWithAnnotations obj) 3455public override bool Equals(TypeWithAnnotations x, TypeWithAnnotations y)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (39)
138ArrayBuilder<TypeWithAnnotations> typeArguments, 174ArrayBuilder<TypeWithAnnotations> typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 186ArrayBuilder<TypeWithAnnotations> typeArguments, 239var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(0); 353ArrayBuilder<TypeWithAnnotations> typeArguments, 429ArrayBuilder<TypeWithAnnotations> typeArguments, 563var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 937if (IsValidParams(_binder, constructor, disallowExpandedNonArrayParams: false, out TypeWithAnnotations definitionElementType)) 1000TypeWithAnnotations definitionParamsElementType, 1049ArrayBuilder<TypeWithAnnotations> typeArguments, 1184if ((options & Options.IsMethodGroupConversion) == 0 && IsValidParams(_binder, leastOverriddenMember, disallowExpandedNonArrayParams, out TypeWithAnnotations definitionElementType)) 1285public static bool IsValidParams(Binder binder, Symbol member, bool disallowExpandedNonArrayParams, out TypeWithAnnotations definitionElementType) 1313public static bool TryInferParamsCollectionIterationType(Binder binder, TypeSymbol type, out TypeWithAnnotations elementType) 2558static TypeSymbol getParameterTypeAndRefKind(int i, MemberAnalysisResult result, ImmutableArray<ParameterSymbol> parameters, TypeWithAnnotations paramsElementTypeOpt, out RefKind parameter1RefKind) 3188CollectionExpressionTypeKind kind1 = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, t1, out TypeWithAnnotations elementType1); 3189CollectionExpressionTypeKind kind2 = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, t2, out TypeWithAnnotations elementType2); 3216if (type.IsArrayInterface(out TypeWithAnnotations typeArg)) 3260var x = lambda.GetInferredReturnType(ref useSiteInfo, out _); 3674var x = lambda.InferReturnType(Conversions, d1, ref useSiteInfo, out _); 3783out ImmutableArray<TypeWithAnnotations> parameterTypes, 3799internal readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 3803internal EffectiveParameters(ImmutableArray<TypeWithAnnotations> types, ImmutableArray<RefKind> refKinds, int firstParamsElementIndex) 3839var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3976var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3982TypeWithAnnotations paramsIterationType = default; 3989var type = parameter.TypeWithAnnotations; 4025ArrayBuilder<TypeWithAnnotations> typeArguments, 4103ArrayBuilder<TypeWithAnnotations> typeArguments, 4105TypeWithAnnotations definitionParamsElementType, 4166ArrayBuilder<TypeWithAnnotations> typeArgumentsBuilder, 4170TypeWithAnnotations definitionParamsElementTypeOpt, 4191ImmutableArray<TypeWithAnnotations> typeArguments; 4304private ImmutableArray<TypeWithAnnotations> InferMethodTypeArguments( 4350return default(ImmutableArray<TypeWithAnnotations>); 4356return default(ImmutableArray<TypeWithAnnotations>); 4362TypeWithAnnotations definitionParamsElementTypeOpt, 4374TypeWithAnnotations paramsElementTypeOpt; 4380paramsElementTypeOpt = TypeWithAnnotations.Create(ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1337TypeWithAnnotations.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)
543public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 549public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 554public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 560: this(syntax, aliasOpt, null, TypeWithAnnotations.Create(type), hasErrors) 564public 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, 462public bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType) 468public TypeWithAnnotations InferReturnType(ConversionsBase conversions, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 478public TypeWithAnnotations ParameterTypeWithAnnotations(int index) { return Data.ParameterTypeWithAnnotations(index); } 556public abstract bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType); 562public abstract TypeWithAnnotations ParameterTypeWithAnnotations(int index); 615var type = lambda.InferredReturnType.TypeWithAnnotations; 625var type = BindForErrorRecovery().InferredReturnType.TypeWithAnnotations; 638private static TypeWithAnnotations DelegateReturnTypeWithAnnotations(MethodSymbol? invokeMethod, out RefKind refKind) 649internal (ImmutableArray<RefKind>, ArrayBuilder<ScopedKind>, ImmutableArray<TypeWithAnnotations>, bool) CollectParameterProperties() 653var parameterTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(ParameterCount); 660var type = ParameterTypeWithAnnotations(i); 715if (!HasExplicitReturnType(out var returnRefKind, out var returnType)) 719var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 761returnType = TypeWithAnnotations.Create(Binder.Compilation.GetSpecialType(SpecialType.System_Void)); 779var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind); 883TypeWithAnnotations returnType, 884ImmutableArray<TypeWithAnnotations> parameterTypes, 900var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind); 905private void ValidateUnsafeParameters(BindingDiagnosticBag diagnostics, ImmutableArray<TypeWithAnnotations> targetParameterTypes) 932ImmutableArray<TypeWithAnnotations> parameterTypes, 935bool hasExplicitReturnType = HasExplicitReturnType(out var refKind, out var returnType); 954var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 964? TypeWithAnnotations.Create(this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)) 965: TypeWithAnnotations.Create(LambdaSymbol.InferenceFailureReturnType); 989ImmutableArray<TypeWithAnnotations> parameterTypes, 991TypeWithAnnotations returnType, 1025public readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 1029public static readonly ReturnInferenceCacheKey Empty = new ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty, null); 1031private ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations> parameterTypes, ImmutableArray<RefKind> parameterRefKinds, NamedTypeSymbol? taskLikeReturnTypeOpt) 1071foreach (var type in ParameterTypes) 1091out ImmutableArray<TypeWithAnnotations> parameterTypes, 1097parameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 1106var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(parameterCount); 1183?? rebind(ReallyInferReturnType(delegateType: null, ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty)); 1199ImmutableArray<TypeWithAnnotations> parameterTypes, 1202var returnType = inferredReturnType.TypeWithAnnotations; 1214returnType = TypeWithAnnotations.Create(t); 1429private readonly TypeWithAnnotations _returnType; 1433private readonly ImmutableArray<TypeWithAnnotations> _parameterTypesWithAnnotations; 1444TypeWithAnnotations returnType, 1448ImmutableArray<TypeWithAnnotations> parameterTypesWithAnnotations, 1474public override bool HasExplicitReturnType(out RefKind refKind, out TypeWithAnnotations returnType) 1552public 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)
649arrayType = arrayType.WithElementType(TypeWithAnnotations.Create(elementType.EnumUnderlyingTypeOrSelf()));
CodeGen\Optimizer.cs (1)
2391public override TypeWithAnnotations TypeWithAnnotations
Compilation\CSharpCompilation.cs (10)
2246var firstType = method.Parameters[0].TypeWithAnnotations; 2380return ArrayTypeSymbol.CreateCSharpArray(this.Assembly, TypeWithAnnotations.Create(elementType, elementNullableAnnotation), rank); 2393return new PointerTypeSymbol(TypeWithAnnotations.Create(elementType, elementNullableAnnotation)); 4072var returnTypeWithAnnotations = TypeWithAnnotations.Create(returnType.EnsureCSharpSymbolOrNull(nameof(returnType)), returnType.NullableAnnotation.ToInternalAnnotation()); 4074type => TypeWithAnnotations.Create(type.EnsureCSharpSymbolOrNull(nameof(parameterTypes)), type.NullableAnnotation.ToInternalAnnotation())); 4122var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(elementTypes.Length); 4128typesBuilder.Add(TypeWithAnnotations.Create(elementType, annotation)); 4166(t, a) => TypeWithAnnotations.Create(t.Type, a.ToInternalAnnotation()))); 4196fields.Add(new AnonymousTypeField(name, location, TypeWithAnnotations.Create(type, nullableAnnotation), RefKind.None, ScopedKind.None));
Compilation\CSharpSemanticModel.cs (3)
4666ImmutableArray<TypeWithAnnotations> typeArguments, 4705ImmutableArray<TypeWithAnnotations> typeArguments, 4773AddReducedAndFilteredMethodGroupSymbol(methodBuilder, filteredMethodBuilder, method, default(ImmutableArray<TypeWithAnnotations>), extensionThisType, compilation);
Compiler\ClsComplianceChecker.cs (6)
283foreach (var paramType in constructor.ParameterTypesWithAnnotations) // Public caller would select type out of parameters. 559foreach (TypeWithAnnotations constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 637foreach (var type in attribute.AttributeConstructor.ParameterTypesWithAnnotations) 1044foreach (TypeWithAnnotations typeArg in type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1325ImmutableArray<TypeWithAnnotations> xParameterTypes; 1326ImmutableArray<TypeWithAnnotations> yParameterTypes;
Compiler\MethodBodySynthesizer.cs (1)
434tmps[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)
397var otherReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(otherReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 399var otherParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 404var otherParamsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount); 524bool isCorrespondingType(TypeWithAnnotations type, TypeWithAnnotations expectedType) 526var otherType = type.WithTypeAndModifiers((TypeSymbol?)this.Visit(type.Type), this.VisitCustomModifiers(type.CustomModifiers)); 694private static void ValidateFunctionPointerParamOrReturn(TypeWithAnnotations type, RefKind refKind, ImmutableArray<CustomModifier> refCustomModifiers, bool allowOut) 740private bool AreTypesEqual(TypeWithAnnotations type, TypeWithAnnotations other) 913var translatedReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(translatedReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 916var translatedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 921var translatedParamsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount);
Emitter\Model\ArrayTypeSymbolAdapter.cs (1)
26TypeWithAnnotations elementType = AdaptedArrayTypeSymbol.ElementTypeWithAnnotations;
Emitter\Model\FieldSymbolAdapter.cs (1)
35TypeWithAnnotations 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)
253foreach (var arg in AdaptedMethodSymbol.TypeArgumentsWithAnnotations)
Emitter\Model\MostCommonNullableValueBuilder.cs (1)
69internal void AddValue(TypeWithAnnotations type)
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
495var type = TypeWithAnnotations.Create(@interface);
Emitter\Model\PEModuleBuilder.cs (3)
1552internal SynthesizedAttributeData SynthesizeNullableAttributeIfNecessary(Symbol symbol, byte? nullableContextValue, TypeWithAnnotations type) 1579var byteArrayType = ArrayTypeSymbol.CreateSZArray(byteType.ContainingAssembly, TypeWithAnnotations.Create(byteType)); 1665var 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)
257foreach (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 (214)
100public readonly TypeWithAnnotations LValueType; 111public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType) 120public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 129LValueType = TypeWithAnnotations.Create(type, annotation); 137public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, VisitResult[] nestedVisitResults) 143internal VisitResult WithLValueType(TypeWithAnnotations lvalueType) 204private ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? _returnTypesOpt; 242private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt; 247/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 249private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion 250=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 315private TypeWithAnnotations LvalueResultType 320private void SetLvalueResultType(BoundExpression? expression, TypeWithAnnotations type) 335private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null) 355private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null) 459ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 720TypeWithAnnotations symbolType; 838var type = memberToInitialize.GetTypeOrReturnType(); 1686ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt) 1732ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 1913if (!_variables.TryGetType(local, out TypeWithAnnotations localType)) 1922if (!_variables.TryGetType(parameter, out TypeWithAnnotations parameterType)) 2221private TypeWithAnnotations VisitLvalueWithAnnotations(BoundExpression node) 2262private static bool ShouldReportNullableAssignment(TypeWithAnnotations type, NullableFlowState state) 2298TypeWithAnnotations targetType, 2371TypeWithAnnotations overriddenType, 2373TypeWithAnnotations overridingType, 2444static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2520TypeWithAnnotations targetType, 2563static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2630TypeWithAnnotations fieldOrPropertyType = member.GetTypeOrReturnType(); 2812var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations; 2818private void EnterParameter(ParameterSymbol parameter, TypeWithAnnotations parameterType) 2847var parameterLValueType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 2863internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 2893TryGetReturnType(out TypeWithAnnotations returnType, out FlowAnalysisAnnotations returnAnnotations)) 2951private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 2957var lvalueResultType = LvalueResultType; 2973private bool TryGetReturnType(out TypeWithAnnotations type, out FlowAnalysisAnnotations annotations) 2984var returnType = delegateOrMethod.ReturnTypeWithAnnotations; 3028var type = GetDeclaredLocalResult(local); 3036type = TypeWithAnnotations.Create(node.Type, type.NullableAnnotation); 3391var resultType = ResultType.ToTypeWithAnnotations(compilation); 3492TypeWithAnnotations type = local.TypeWithAnnotations; 3695var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 3750(TypeWithAnnotations resultTypeWithAnnotations) => convertCollection(node, resultTypeWithAnnotations, elementConversionCompletions); 3759var resultType = TypeWithAnnotations.Create(node.Type); 3766TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions) 3808(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(BoundCollectionExpression node, TypeSymbol collectionType) 3810var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 3922(TypeWithAnnotations resultTypeWithAnnotations) => 4001var parameterType = constructor.ParameterTypesWithAnnotations[0]; 4002if (AreNullableAndUnderlyingTypes(type, parameterType.Type, out TypeWithAnnotations underlyingType)) 4250Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4261var type = ApplyLValueAnnotations(symbol.GetTypeOrReturnType(), GetObjectInitializerMemberLValueAnnotations(symbol)); 4283Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4416var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4468return GetOrCreatePlaceholderSlot(node, TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated)); 4471private int GetOrCreatePlaceholderSlot(object identifier, TypeWithAnnotations type) 4621TypeWithAnnotations inferredType = (bestType is null) 4623: TypeWithAnnotations.Create(bestType); 4662static TypeWithAnnotations getSpanElementType(NamedTypeSymbol namedType) 4669static TypeSymbol setSpanElementType(NamedTypeSymbol namedType, TypeWithAnnotations elementType) 4698internal static TypeWithAnnotations BestTypeForLambdaReturns( 4699ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns, 4721var resultTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(n); 4734TypeWithAnnotations inferredType; 4738var bestTypeWithObliviousAnnotation = TypeWithAnnotations.Create(bestType); 4750inferredType = TypeWithAnnotations.Create(bestType, BestTypeInferrer.GetNullableAnnotation(resultTypes)); 4797TypeWithAnnotations result; 4801result = TypeWithAnnotations.Create(type); 4824TypeWithAnnotations type = expressionType.TryGetInlineArrayElementField()!.TypeWithAnnotations; 4828type = TypeWithAnnotations.Create(((NamedTypeSymbol)node.Type).OriginalDefinition.Construct(ImmutableArray.Create(type))); 5053SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5115var targetTypeWithNullability = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 5119targetTypeWithNullability = TypeWithAnnotations.Create(MakeNullableOf(targetTypeWithNullability)); 5164TypeWithAnnotations.Create(expr.Type), 5550TypeWithAnnotations targetType = VisitLvalueWithAnnotations(leftOperand); 5568targetType = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 5659TypeWithAnnotations.Create(rightType), 5695TypeWithAnnotations explicitType = boundConversion.ConversionGroupOpt?.ExplicitType ?? default; 5697TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(boundConversion.Type); 5835var accessTypeWithAnnotations = LvalueResultType; 5891TypeWithAnnotations consequenceLValue; 5892TypeWithAnnotations alternativeLValue; 5912var refResultTypeWithAnnotations = TypeWithAnnotations.Create(refResultType, lValueAnnotation); 5921SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 5972TypeWithAnnotations resultTypeWithAnnotations; 5993resultTypeWithAnnotations = TypeWithAnnotations.Create(resultType); 6006BoundExpression alternative, Conversion alternativeConversion, bool alternativeEndReachable, TypeWithAnnotations resultTypeWithAnnotations, bool wasTargetTyped) 6063(TypeWithAnnotations resultTypeWithAnnotations) => 6085(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6089TypeWithAnnotations lValueType = VisitLvalueWithAnnotations(operand); 6093void reportMismatchIfNecessary(BoundExpression node, TypeWithAnnotations source, TypeWithAnnotations destination) 6106TypeWithAnnotations targetType, 6154private static BoundExpression CreatePlaceholderIfNecessary(BoundExpression expr, TypeWithAnnotations type) 6221TypeWithAnnotations paramsIterationType = default; 6365var parameterType = method.Parameters[0].TypeWithAnnotations; 6625private static TypeWithAnnotations ApplyLValueAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations flowAnalysisAnnotations) 6657private static TypeWithAnnotations ApplyUnconditionalAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations annotations) 6853TypeWithAnnotations paramsIterationType = default; 6860(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, bool isExpandedParamsArgument) = 6926TypeWithAnnotations paramsIterationType = default; 6932(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, _) = 7077completion(TypeWithAnnotations.Create(argument.Type)); 7259TypeWithAnnotations paramsIterationType = default; 7269TypeWithAnnotations paramsIterationType = default; 7348TypeWithAnnotations parameterType, 7403var lvalueResultType = result.LValueType; 7485TypeWithAnnotations parameterType, 7515var lValueType = result.LValueType; 7539var declaredType = result.LValueType; 7541var lValueType = ApplyLValueAnnotations(declaredType, leftAnnotations); 7544var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 7598void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7781private (ParameterSymbol? Parameter, TypeWithAnnotations Type, FlowAnalysisAnnotations Annotations, bool isExpandedParamsArgument) GetCorrespondingParameter( 7786ref TypeWithAnnotations paramsIterationType) 7800var type = parameter.TypeWithAnnotations; 7847parameterTypes: out ImmutableArray<TypeWithAnnotations> parameterTypes, 7880internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 7882return TypeWithAnnotations.Create(expr.GetTypeOrFunctionType(), GetNullableAnnotation(expr)); 7913internal override TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method) 7981var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8267TypeWithAnnotations explicitType = node.ConversionGroupOpt?.ExplicitType ?? default; 8269TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(node.Type); 8307private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8319private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8321TypeWithAnnotations targetTypeOpt, 8333(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8335TypeWithAnnotations targetTypeOpt, 8370Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8372return (TypeWithAnnotations targetTypeOpt) => 8381private static bool AreNullableAndUnderlyingTypes([NotNullWhen(true)] TypeSymbol? nullableTypeOpt, [NotNullWhen(true)] TypeSymbol? underlyingTypeOpt, out TypeWithAnnotations underlyingTypeWithAnnotations) 8386var typeArg = nullableTypeOpt.GetNullableUnderlyingTypeWithAnnotations(); 8421ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 8778TypeWithAnnotations targetTypeWithNullability, 8799if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 8990if (AreNullableAndUnderlyingTypes(targetType, operandType.Type, out TypeWithAnnotations underlyingType)) 9130static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9146static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9180static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9240foreach (var constraintType in typeParameter1.ConstraintTypesNoUseSiteDiagnostics) 9330TypeWithAnnotations targetTypeWithNullability, 9362TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.FromType), 9382var parameterType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 9388var underlyingOperandTypeWithAnnotations = operandType.Type.GetNullableUnderlyingTypeWithAnnotations(); 9414var methodReturnType = method.ReturnTypeWithAnnotations; 9433TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.ToType), 9514private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9535private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9542private TypeSymbol MakeNullableOf(TypeWithAnnotations underlying) 9549TypeWithAnnotations targetType, 9649(TypeWithAnnotations resultTypeWithAnnotations) => 9730var argTypeWithAnnotations = TypeWithAnnotations.Create(argType, NullableAnnotation.NotAnnotated); 9827var parameterType = parameter.TypeWithAnnotations; 9917var lvalueResult = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 9925var parameterType = GetDeclaredParameterResult(parameter); 9942TypeWithAnnotations declaredType = LvalueResultType; 9943TypeWithAnnotations leftLValueType = ApplyLValueAnnotations(declaredType, leftAnnotations); 9972var lvalueType = rightState.ToTypeWithAnnotations(compilation); 9990var type = property.TypeWithAnnotations; 9992var lValueType = ApplyLValueAnnotations(type, annotations); 10314AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType)) 10330internal readonly TypeWithAnnotations Type; 10333internal DeconstructionVariable(BoundExpression expression, TypeWithAnnotations type) 10417var operandLvalue = LvalueResultType; 10424TypeWithAnnotations targetTypeOfOperandConversion; 10480var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 10522var leftLvalueType = LvalueResultType; 10600var paramType = parameter.TypeWithAnnotations; 10635private TypeWithAnnotations GetDeclaredLocalResult(LocalSymbol local) 10637return _variables.TryGetType(local, out TypeWithAnnotations type) ? 10642private TypeWithAnnotations GetDeclaredParameterResult(ParameterSymbol parameter) 10644return _variables.TryGetType(parameter, out TypeWithAnnotations type) ? 10772var type = member.GetTypeOrReturnType(); 10893TypeWithAnnotations targetTypeWithAnnotations; 10929targetTypeWithAnnotations = TypeWithAnnotations.Create(collectionExpression.Type); 10936targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 10987TypeWithAnnotations.Create(enumeratorInfoOpt.ElementType, NullableAnnotation.NotAnnotated).ToTypeWithState(); 11068TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 11097TypeWithAnnotations destinationType = iterationVariable.TypeWithAnnotations; 11195var type = TypeWithAnnotations.Create(node.Type); 11296var type = TypeWithAnnotations.Create(node.Type); 11304var type = TypeWithAnnotations.Create(node.Type); 11326var type = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 11654var result = TypeWithAnnotations.Create(node.Type); 11674var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 11780var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 11849private static bool IsNullabilityMismatch(TypeWithAnnotations type1, TypeWithAnnotations type2) 11951var result = TypeWithAnnotations.Create(node.Type, node.IsInferred ? NullableAnnotation.Annotated : node.NullableAnnotation); 11995TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None, 12048var typeWithAnnotations = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 12113var 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)
60internal TypeWithAnnotations? GetUpdatedTypeForLocalSymbol(SourceLocalSymbol symbol) 64if (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)
387var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 451var parameterType = method.Parameters[i + extensionExtra].TypeWithAnnotations; 476outputSlot = makeDagTempSlot(TypeWithAnnotations.Create(e.Type, NullableAnnotation.NotAnnotated), output); 489var type = field.TypeWithAnnotations; 535var type = property.TypeWithAnnotations; 560TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: false); 572TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: true); 684var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 685if (_variables.TryGetType(local, out var existingType)) 688inferredType = TypeWithAnnotations.Create(inferredType.Type, existingType.NullableAnnotation.Join(inferredType.NullableAnnotation)); 831int makeDagTempSlot(TypeWithAnnotations type, BoundDagTemp temp) 839var type = TypeWithAnnotations.Create(t, NullableAnnotation.Annotated); 846static TypeWithAnnotations getIndexerOutputType(TypeSymbol inputType, BoundExpression e, bool isSlice) 854? TypeWithAnnotations.Create(isNullableEnabled: true, inputType, isAnnotated: false) 955var inferredTypeWithAnnotations = TypeWithAnnotations.Create(inferredType); 991TypeWithAnnotations inferredTypeWithAnnotations, 1038(TypeWithAnnotations inferredTypeWithAnnotations) =>
Generated\BoundNodes.xml.Generated.cs (9)
1069public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1085public TypeWithAnnotations TypeWithAnnotations { get; } 1090public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 5838public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false) 5855public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 5863public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type) 6075public 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) 6091public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 6102public 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)
187var pendingExceptionLocal = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax); 189var pendingBranchVar = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(_F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax); 1008this.returnValue = returnValue = new SynthesizedLocal(containingMethod, TypeWithAnnotations.Create(valueOpt.Type), SynthesizedLocalKind.AsyncMethodReturnValue, _syntaxOpt); 1044this.pendingCaughtException = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Object)), SynthesizedLocalKind.TryAwaitPendingCaughtException, tryStatementSyntax); 1045this.pendingCatch = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingCatch, tryStatementSyntax);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
435typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty,
Lowering\ClosureConversion\ClosureConversion.cs (11)
662var frameTypeParameters = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, frame.Arity); 666LocalSymbol framePointer = new SynthesizedLocal(_topLevelMethod, TypeWithAnnotations.Create(frameType), SynthesizedLocalKind.LambdaDisplayClass, frame.ScopeSyntaxOpt); 960private ImmutableArray<TypeWithAnnotations> SubstituteTypeArguments(ImmutableArray<TypeWithAnnotations> typeArguments) 984var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Length); 985foreach (var typeArg in typeArguments) 987TypeWithAnnotations oldTypeArg; 988TypeWithAnnotations newTypeArg = typeArg; 1013ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 1025var realTypeArguments = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, totalTypeArgumentCount - originalMethod.Arity); 1651RemapLambdaOrLocalFunction(node.Syntax, node.Symbol, default(ImmutableArray<TypeWithAnnotations>), closureKind, ref referencedMethod, out receiver, out constructedFrame);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (4)
21private readonly TypeWithAnnotations _type; 24private LambdaCapturedVariable(SynthesizedClosureEnvironment frame, TypeWithAnnotations type, string fieldName, bool isThisParameter) 48return new LambdaCapturedVariable(frame, TypeWithAnnotations.Create(type), fieldName, IsThis(captured)); 124internal 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)
415static bool hasReturnTypeOrParameter(LocalFunctionSymbol localFunction, Func<TypeWithAnnotations, bool> predicate) => 844var 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 (2)
31ImmutableArray<TypeWithAnnotations> typeArguments; 156var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (12)
46if (ConversionsBase.IsSpanOrListType(_compilation, node.Type, WellKnownType.System_Collections_Generic_List_T, out var listElementType)) 63return VisitArrayOrSpanCollectionExpression(node, collectionTypeKind, node.Type, TypeWithAnnotations.Create(elementType)); 66if (ConversionsBase.IsSpanOrListType(_compilation, node.Type, WellKnownType.System_Collections_Immutable_ImmutableArray_T, out var arrayElementType)) 160private bool TryRewriteSingleElementSpreadToList(BoundCollectionExpression node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result) 235private BoundExpression VisitImmutableArrayCollectionExpression(BoundCollectionExpression node, TypeWithAnnotations elementType, MethodSymbol asImmutableArray) 246private BoundExpression VisitArrayOrSpanCollectionExpression(BoundCollectionExpression node, CollectionExpressionTypeKind collectionTypeKind, TypeSymbol collectionType, TypeWithAnnotations elementType) 405var elementType = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 483var elementType = spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 542TypeWithAnnotations elementType, 576Construct(ImmutableArray.Create(TypeWithAnnotations.Create(inlineArrayType), elementType)); 605inlineArrayAsSpan = inlineArrayAsSpan.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(inlineArrayType), elementType)); 1021private BoundExpression CreateAndPopulateList(BoundCollectionExpression node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
104var byteArray = ArrayTypeSymbol.CreateSZArray(_compilation.Assembly, TypeWithAnnotations.Create(byteType)); 668TypeWithAnnotations sourceElementType = ((NamedTypeSymbol)sourceType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 689TypeWithAnnotations sourceElementType = ((NamedTypeSymbol)sourceType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0];
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)
517TypeWithAnnotations arrayElementType = arrayType.ElementTypeWithAnnotations;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
129ImmutableArray<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); 336var visitedTypeArgs = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArgs.Length); 337foreach (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)
96public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 97=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 203public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Lowering\SyntheticBoundNodeFactory.cs (10)
170public StateMachineFieldSymbol StateMachineField(TypeWithAnnotations type, string name, bool isPublic = false, bool isThis = false) 181var result = new StateMachineFieldSymbol(CurrentType, TypeWithAnnotations.Create(type), name, isPublic, isThis); 595return new SynthesizedLocal(CurrentFunction, TypeWithAnnotations.Create(type), kind, syntax, isPinned, 615TypeWithAnnotations.Create(type), 626return SynthesizedParameterSymbol.Create(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, name); 1223public BoundExpression NullRef(TypeWithAnnotations type) 1274public BoundExpression Typeof(TypeWithAnnotations type, TypeSymbol systemType) 1279public ImmutableArray<BoundExpression> TypeOfs(ImmutableArray<TypeWithAnnotations> typeArguments, TypeSymbol systemType) 1682TypeWithAnnotations.Create(type), 1721temp = new SynthesizedLocal(this.CurrentFunction, TypeWithAnnotations.Create(node.Type), SynthesizedLocalKind.LoweringTemp);
Operations\CSharpOperationFactory.cs (1)
2078TypeWithAnnotations.Create(((CSharpCompilation)_semanticModel.Compilation).GetSpecialType(SpecialType.System_Boolean)),
Symbols\AbstractTypeMap.cs (30)
60ImmutableArray<TypeWithAnnotations> oldTypeArguments = previous.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 62var newTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldTypeArguments.Length); 66var oldArgument = oldTypeArguments[i]; 67var newArgument = oldArgument.SubstituteType(this); 92internal TypeWithAnnotations SubstituteType(TypeSymbol previous) 95return default(TypeWithAnnotations); 125return TypeWithAnnotations.Create(result); 128internal TypeWithAnnotations SubstituteType(TypeWithAnnotations previous) 179protected virtual TypeWithAnnotations SubstituteTypeParameter(TypeParameterSymbol typeParameter) 181return TypeWithAnnotations.Create(typeParameter); 186var oldElement = t.ElementTypeWithAnnotations; 187TypeWithAnnotations element = oldElement.SubstituteType(this); 229var oldPointedAtType = t.PointedAtTypeWithAnnotations; 230var pointedAtType = oldPointedAtType.SubstituteType(this); 241var substitutedReturnType = f.Signature.ReturnTypeWithAnnotations.SubstituteType(this); 246ImmutableArray<TypeWithAnnotations> substitutedParamTypes = SubstituteTypes(parameterTypesWithAnnotations); 320internal ImmutableArray<TypeWithAnnotations> SubstituteTypes(ImmutableArray<TypeWithAnnotations> original) 324return default(ImmutableArray<TypeWithAnnotations>); 327var result = ArrayBuilder<TypeWithAnnotations>.GetInstance(original.Length); 329foreach (TypeWithAnnotations t in original) 343ImmutableArray<TypeWithAnnotations> original, 344ArrayBuilder<TypeWithAnnotations> result, 355var type = original[0]; 365foreach (var type in original) 370var substituted = substituteConstraintType(type); 387TypeWithAnnotations substituteConstraintType(TypeWithAnnotations type) 394TypeWithAnnotations 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)
202var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(nTypeArguments); 236var original = TypeWithAnnotations.Create(genericFieldTypes[index].Type); 238var replacement = TypeWithAnnotations.Create(((ArrayTypeSymbol)lastParam.Type).WithElementType(original));
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
95internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 97get { 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]); 130var type = TypeWithAnnotations.Create(typeParams[i]); 137type = TypeWithAnnotations.Create(ArrayTypeSymbol.CreateSZArray(containingType.ContainingAssembly, type)); 145var returnType = TypeWithAnnotations.Create(returnsVoid ? returnParameter.Type : typeParams[parameterCount]); 206var 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)
250internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (2)
122internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 124return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\ArrayTypeSymbol.cs (24)
22private readonly TypeWithAnnotations _elementTypeWithAnnotations; 26TypeWithAnnotations elementTypeWithAnnotations, 38TypeWithAnnotations elementTypeWithAnnotations, 50TypeWithAnnotations elementTypeWithAnnotations, 67TypeWithAnnotations elementType, 76TypeWithAnnotations elementTypeWithAnnotations, 83TypeWithAnnotations elementTypeWithAnnotations, 92TypeWithAnnotations elementType) 97internal ArrayTypeSymbol WithElementType(TypeWithAnnotations elementTypeWithAnnotations) 102protected abstract ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations); 105TypeWithAnnotations elementTypeWithAnnotations, 201public TypeWithAnnotations ElementTypeWithAnnotations 393TypeWithAnnotations oldElementType = ElementTypeWithAnnotations; 394TypeWithAnnotations newElementType; 406internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 414TypeWithAnnotations elementType = ElementTypeWithAnnotations.MergeEquivalentTypes(((ArrayTypeSymbol)other).ElementTypeWithAnnotations, variance); 512TypeWithAnnotations elementTypeWithAnnotations, 521protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations newElementType) 570TypeWithAnnotations elementTypeWithAnnotations, 604TypeWithAnnotations elementTypeWithAnnotations, 611protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations) 631TypeWithAnnotations elementTypeWithAnnotations, 644protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations)
Symbols\AssemblySymbol.cs (4)
767return ArrayTypeSymbol.CreateCSharpArray(this, TypeWithAnnotations.Create(symbol), rank); 777return new PointerTypeSymbol(TypeWithAnnotations.Create(symbol)); 872var typeArgumentSymbols = ArrayBuilder<TypeWithAnnotations>.GetInstance(length); 880typeArgumentSymbols.Add(TypeWithAnnotations.Create(argSymbol));
Symbols\Compilation_WellKnownMembers.cs (3)
789var boolArray = ArrayTypeSymbol.CreateSZArray(booleanType.ContainingAssembly, TypeWithAnnotations.Create(booleanType)); 806var stringArray = ArrayTypeSymbol.CreateSZArray(stringType.ContainingAssembly, TypeWithAnnotations.Create(stringType)); 1010void handle(RefKind refKind, ImmutableArray<CustomModifier> customModifiers, TypeWithAnnotations twa)
Symbols\ConstraintsHelper.cs (31)
75ImmutableArray<TypeWithAnnotations> constraintTypes, 132ImmutableArray<TypeWithAnnotations> constraintTypes, 152var constraintTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 159foreach (var constraintType in constraintTypes) 344internal static ImmutableArray<ImmutableArray<TypeWithAnnotations>> MakeTypeParameterConstraintTypes( 354return ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 368return ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 893ImmutableArray<TypeWithAnnotations> typeArguments, 930TypeWithAnnotations typeArgument, 1033TypeWithAnnotations typeArgument, 1059var constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1061ImmutableArray<TypeWithAnnotations> originalConstraintTypes = typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 1093static bool errorIfNotSatisfiesConstructorConstraint(Symbol containingSymbol, TypeParameterSymbol typeParameter, TypeWithAnnotations typeArgument, ArrayBuilder<TypeParameterDiagnosticInfo> diagnosticsBuilder) 1119TypeWithAnnotations typeArgument, 1143TypeWithAnnotations typeArgument, 1147TypeWithAnnotations constraintType, 1199static NullableFlowState getTypeArgumentState(in TypeWithAnnotations typeWithAnnotations) 1223foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1238static bool constraintTypeAllows(in TypeWithAnnotations typeWithAnnotations, NullableFlowState state) 1260foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1319TypeWithAnnotations typeArgument, 1320TypeWithAnnotations constraintType, 1369foreach (var typeArgumentConstraint in typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1412private static bool IsReferenceType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1417private static bool IsValueType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1605internal static TypeWithAnnotations ConstraintWithMostSignificantNullability(TypeWithAnnotations type1, TypeWithAnnotations type2) 1625internal static bool IsObjectConstraint(TypeWithAnnotations type, ref TypeWithAnnotations bestObjectConstraint) 1651internal 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)
42internal TypeWithAnnotations Substitute(AbstractTypeMap typeMap) 44return TypeWithAnnotations.Create(typeMap.SubstituteNamedType(this)); 299internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 466protected override NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 659private readonly ImmutableArray<TypeWithAnnotations> _typeArgumentsWithAnnotations; 662public ConstructedErrorTypeSymbol(ErrorTypeSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, TupleExtraData? tupleData = null) : 680internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 719internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
162internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 164return 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, 334TypeWithAnnotations substitutedReturnType, 335ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 352var mergedReturnType = ReturnTypeWithAnnotations.MergeEquivalentTypes(signature.ReturnTypeWithAnnotations, returnVariance); 354var mergedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 358var paramMergedTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_parameters.Length); 371var mergedParameterType = thisParam.TypeWithAnnotations.MergeEquivalentTypes(otherParam.TypeWithAnnotations, paramVariance); 400public FunctionPointerMethodSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 402var transformedReturn = transform(ReturnTypeWithAnnotations); 404var transformedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 408var paramTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_parameters.Length); 411var transformedType = transform(param.TypeWithAnnotations); 444TypeWithAnnotations returnType, 447ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 465var substitutedType = substitutedParameterTypes[i]; 489TypeWithAnnotations returnTypeWithAnnotations, 491ImmutableArray<TypeWithAnnotations> parameterTypes, 520TypeWithAnnotations returnType, 548var returnType = TypeWithAnnotations.Create(retInfo.Type, customModifiers: CSharpCustomModifier.Convert(retInfo.CustomModifiers)); 568var paramType = TypeWithAnnotations.Create(param.Type, customModifiers: CSharpCustomModifier.Convert(param.CustomModifiers)); 605bool madeChanges = ReturnTypeWithAnnotations.ApplyNullableTransforms(defaultTransformFlag, transforms, ref position, out var newReturnType); 606var newParamTypes = ImmutableArray<TypeWithAnnotations>.Empty; 609var paramTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(Parameters.Length); 613madeParamChanges |= param.TypeWithAnnotations.ApplyNullableTransforms(defaultTransformFlag, transforms, ref position, out var newParamType); 768public override TypeWithAnnotations ReturnTypeWithAnnotations { get; } 836public 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)
567TypeWithAnnotations unsubstitutedReturnType1; 572TypeWithAnnotations unsubstitutedReturnType2; 599var returnType1 = SubstituteType(typeMap1, unsubstitutedReturnType1); 600var returnType2 = SubstituteType(typeMap2, unsubstitutedReturnType2); 751private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap? typeMap, HashSet<TypeSymbol> result) 753foreach (var type in types) 777var type1 = SubstituteType(typeMap1, param1.TypeWithAnnotations); 778var type2 = SubstituteType(typeMap2, param2.TypeWithAnnotations); 834private 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)
72private TypeWithAnnotations? TransformTypeWithAnnotations(TypeWithAnnotations type) 129var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 135TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 180var transformedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 185var 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; 318var type = TypeWithAnnotations.Create(typeSymbol, customModifiers: customModifiersArray); 337type = TypeWithAnnotations.Create(new PointerTypeSymbol(TypeWithAnnotations.Create(fixedElementType))); 342Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null); 395internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Metadata\PE\PEMethodSymbol.cs (3)
664public override TypeWithAnnotations ReturnTypeWithAnnotations => Signature.ReturnParam.TypeWithAnnotations; 961public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => IsGenericMethod ? GetTypeParametersAsTypeArguments() : ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (5)
521baseType = (NamedTypeSymbol)NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(decodedType), _handle, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 581typeSymbol = NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(typeSymbol), interfaceImpl, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 1636internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 1640return ImmutableArray<TypeWithAnnotations>.Empty; 2667internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Metadata\PE\PEParameterSymbol.cs (6)
154private readonly TypeWithAnnotations _typeWithAnnotations; 239TypeWithAnnotations typeWithAnnotations, 390var typeWithModifiers = TypeWithAnnotations.Create(type, customModifiers: CSharpCustomModifier.Convert(customModifiers)); 428TypeWithAnnotations type, 921public override TypeWithAnnotations TypeWithAnnotations
Symbols\Metadata\PE\PEPropertySymbol.cs (4)
35private readonly TypeWithAnnotations _propertyTypeWithAnnotations; 303var propertyTypeWithAnnotations = TypeWithAnnotations.Create(originalPropertyType, customModifiers: typeCustomModifiers); 685public 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); 615internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 618return (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)
242public abstract TypeWithAnnotations ReturnTypeWithAnnotations { get; } 263public abstract ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations { get; } 271internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 854return Construct(typeArguments.SelectAsArray(a => TypeWithAnnotations.Create(a))); 857internal MethodSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 898internal ImmutableArray<TypeWithAnnotations> ParameterTypesWithAnnotations 1100internal virtual TypeWithAnnotations IteratorElementTypeWithAnnotations 1159var 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]; 886var typeArgument = typeArguments[i]; 887var otherTypeArgument = otherTypeArguments[i]; 919foreach (TypeWithAnnotations arg in this.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 933var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 939TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 940TypeWithAnnotations newTypeArgument; 959internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 966var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 972TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 973TypeWithAnnotations newTypeArgument = transform(oldTypeArgument); 986internal NamedTypeSymbol WithTypeArguments(ImmutableArray<TypeWithAnnotations> allTypeArguments) 1003var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1034ArrayBuilder<TypeWithAnnotations> allTypeArguments) 1055TypeWithAnnotations typeArgumentA = typeArgumentsA[i]; 1056TypeWithAnnotations typeArgumentB = typeArgumentsB[i]; 1058TypeWithAnnotations merged = typeArgumentA.MergeEquivalentTypes(typeArgumentB, typeArgumentVariance); 1162internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1164internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType(); 1168ImmutableArray<TypeWithAnnotations> modifiedArguments; 1172modifiedArguments = default(ImmutableArray<TypeWithAnnotations>); 1176modifiedArguments = typeArguments.SelectAsArray(t => TypeWithAnnotations.Create(t)); 1182internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 1187internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1224protected virtual NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1273foreach (var argument in TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1279internal ImmutableArray<TypeWithAnnotations> GetAllTypeArguments(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1281ArrayBuilder<TypeWithAnnotations> builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1286internal void GetAllTypeArguments(ArrayBuilder<TypeWithAnnotations> builder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1297internal void GetAllTypeArgumentsNoUseSiteDiagnostics(ArrayBuilder<TypeWithAnnotations> builder) 1316internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 1385foreach (TypeWithAnnotations arg in currentType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Symbols\NativeIntegerTypeSymbol.cs (9)
44internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty; 238internal TypeWithAnnotations SubstituteUnderlyingType(TypeWithAnnotations type) => type.SubstituteType(GetTypeMap()); 347public override TypeWithAnnotations ReturnTypeWithAnnotations => _container.SubstituteUnderlyingType(UnderlyingMethod.ReturnTypeWithAnnotations); 349public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => ImmutableArray<TypeWithAnnotations>.Empty; 419public override TypeWithAnnotations TypeWithAnnotations => _containingType.SubstituteUnderlyingType(_underlyingParameter.TypeWithAnnotations); 470public 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)
86public abstract TypeWithAnnotations TypeWithAnnotations { get; } 117internal 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; 181var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 186var typeArg = typeArgsForConstraintsCheck[i]; 190builder.Add(TypeWithAnnotations.Create(ErrorTypeSymbol.UnknownResultType)); 229ImmutableArray<TypeWithAnnotations> typeArgsForConstruct = typeArgs; 235(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp)); 291public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 492public override TypeWithAnnotations ReturnTypeWithAnnotations 638public 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)
84internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics
Symbols\Retargeting\RetargetingParameterSymbol.cs (3)
27private TypeWithAnnotations.Boxed? _lazyTypeWithAnnotations; 40public sealed override TypeWithAnnotations TypeWithAnnotations 47new TypeWithAnnotations.Boxed(this.RetargetingModule.RetargetingTranslator.Retarget(_underlyingParameter.TypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode)),
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 (18)
180public TypeWithAnnotations Retarget(TypeWithAnnotations underlyingType, RetargetOptions options, NamedTypeSymbol asDynamicIfNoPiaContainingType = null) 515var oldArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 534var newArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldArguments.Count); 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); 860public ImmutableArray<TypeWithAnnotations> Retarget(ImmutableArray<TypeWithAnnotations> sequence) 1112var 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; } } 129public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyParameterSymbol.cs (3)
17private readonly TypeWithAnnotations _type; 24TypeWithAnnotations type, 40public 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)
197internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 199return 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)
21private TypeWithAnnotations.Boxed _lazyType; 70internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 84TypeWithAnnotations type; 113type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 127private TypeWithAnnotations SetType(BindingDiagnosticBag diagnostics, TypeWithAnnotations type) 138if (Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null) == null) 152internal 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)); 212internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 214return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Source\LambdaParameterSymbol.cs (3)
13private readonly TypeWithAnnotations _parameterType; 20TypeWithAnnotations parameterType, 35public override TypeWithAnnotations TypeWithAnnotations => _parameterType;
Symbols\Source\LambdaSymbol.cs (13)
23private TypeWithAnnotations _returnType; 46ImmutableArray<TypeWithAnnotations> parameterTypes, 49TypeWithAnnotations returnType) : 62_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 150public override TypeWithAnnotations ReturnTypeWithAnnotations 159internal void SetInferredReturnType(RefKind refKind, TypeWithAnnotations inferredReturnType) 187public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 189get { return ImmutableArray<TypeWithAnnotations>.Empty; } 324ImmutableArray<TypeWithAnnotations> parameterTypes, 354TypeWithAnnotations type; 373type = TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(compilation, name: string.Empty, arity: 0, errorInfo: null)); 427public 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)
27private ImmutableArray<ImmutableArray<TypeWithAnnotations>> _lazyTypeParameterConstraintTypes; 29private TypeWithAnnotations.Boxed? _lazyReturnType; 228public override TypeWithAnnotations ReturnTypeWithAnnotations 252TypeWithAnnotations returnType = WithTypeParametersBinder.BindType(returnTypeSyntax.SkipScoped(out _).SkipRef(), diagnostics); 301Interlocked.CompareExchange(ref _lazyReturnType, new TypeWithAnnotations.Boxed(returnType), null); 309public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => GetTypeParametersAsTypeArguments(); 467public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes()
Symbols\Source\ParameterHelpers.cs (5)
41parameterCreationFunc: (Binder context, Symbol owner, TypeWithAnnotations parameterType, 81parameterCreationFunc: (Binder binder, FunctionPointerMethodSymbol owner, TypeWithAnnotations parameterType, 124Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 181var parameterType = withTypeParametersBinder.BindType(parameterSyntax.Type, diagnostics, suppressUseSiteDiagnostics: suppressUseSiteDiagnostics); 652TypeWithAnnotations typeWithAnnotations,
Symbols\Source\SourceClonedParameterSymbol.cs (1)
88public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceComplexParameterSymbol.cs (7)
1556var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(DeclaringCompilation, Type, out TypeWithAnnotations elementTypeWithAnnotations); 1689private readonly TypeWithAnnotations _parameterType; 1694TypeWithAnnotations parameterType, 1708public override TypeWithAnnotations TypeWithAnnotations => _parameterType; 1715private readonly TypeWithAnnotations _parameterType; 1720TypeWithAnnotations parameterType, 1740public override TypeWithAnnotations TypeWithAnnotations => _parameterType;
Symbols\Source\SourceConstructorSymbolBase.cs (5)
20private TypeWithAnnotations _lazyReturnType; 58_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 137public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 138=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 143public 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, 56var returnType = binder.BindType(returnTypeSyntax, diagnostics); 59var voidType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 61var objectType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax)); 62var intPtrType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax)); 84var iAsyncResultType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax)); 85var asyncCallbackType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax)); 152public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 153=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 158public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 213TypeWithAnnotations voidType, 214TypeWithAnnotations objectType, 215TypeWithAnnotations intPtrType, 258TypeWithAnnotations returnType, 351TypeWithAnnotations iAsyncResultType, 352TypeWithAnnotations objectType, 353TypeWithAnnotations asyncCallbackType, 391TypeWithAnnotations iAsyncResultType,
Symbols\Source\SourceDestructorSymbol.cs (5)
16private TypeWithAnnotations _lazyReturnType; 85_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 114public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 115=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 120public override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceEnumConstantSymbol.cs (2)
60internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 62return TypeWithAnnotations.Create(this.ContainingType);
Symbols\Source\SourceEventAccessorSymbol.cs (7)
22private TypeWithAnnotations _lazyReturnType; 122_lazyReturnType = TypeWithAnnotations.Create(eventTokenType); 133_lazyReturnType = TypeWithAnnotations.Create(voidType); 144_lazyReturnType = TypeWithAnnotations.Create(voidType); 160public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 191public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 192=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\SourceEventSymbol.cs (4)
91public abstract override TypeWithAnnotations TypeWithAnnotations { get; } 329var type = this.TypeWithAnnotations; 623protected static void CopyEventCustomModifiers(EventSymbol eventWithCustomModifiers, ref TypeWithAnnotations type, AssemblySymbol containingAssembly) 738protected TypeWithAnnotations BindEventType(Binder binder, TypeSyntax typeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceFieldLikeEventSymbol.cs (2)
24private readonly TypeWithAnnotations _type; 142public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceLocalSymbol.cs (19)
39private TypeWithAnnotations.Boxed _type; 291public override TypeWithAnnotations TypeWithAnnotations 301TypeWithAnnotations localType = GetTypeSymbol(); 324TypeWithAnnotations declType = this.TypeSyntaxBinder.BindTypeOrVarKeyword(typeSyntax, BindingDiagnosticBag.Discarded, out isVar); 332private TypeWithAnnotations GetTypeSymbol() 347TypeWithAnnotations declType; 360var inferredType = InferTypeOfVarVariable(diagnostics); 371declType = TypeWithAnnotations.Create(typeBinder.CreateErrorType("var")); 380protected virtual TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 388internal void SetTypeWithAnnotations(TypeWithAnnotations newType) 391TypeWithAnnotations? originalType = _type?.Value; 402Interlocked.CompareExchange(ref _type, new TypeWithAnnotations.Boxed(newType), null); 561protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 564return TypeWithAnnotations.Create(initializerOpt?.Type); 644protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 679protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 698return TypeWithAnnotations.Create(_nodeBinder.CreateErrorType()); 763protected override TypeWithAnnotations InferTypeOfVarVariable(BindingDiagnosticBag diagnostics) 813SetTypeWithAnnotations(TypeWithAnnotations.Create(_nodeBinder.CreateErrorType("var")));
Symbols\Source\SourceMemberContainerSymbol.cs (13)
4299TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4338TypeWithAnnotations.Create(this), 4347TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4387TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Text_StringBuilder)), 4395returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 4450returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_String)), 4624TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Int32)), 4653TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Type)), 4714TypeWithAnnotations.Create(this), 4723TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 5286builder.AddValue(TypeWithAnnotations.Create(baseType)); 5290builder.AddValue(TypeWithAnnotations.Create(@interface)); 5350AddSynthesizedAttribute(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; 1049TypeWithAnnotations overridingMemberType = overridingProperty.TypeWithAnnotations; 1050TypeWithAnnotations overriddenMemberType = overriddenProperty.TypeWithAnnotations; 1198private bool IsValidOverrideReturnType(Symbol overridingSymbol, TypeWithAnnotations overridingReturnType, TypeWithAnnotations overriddenReturnType, BindingDiagnosticBag diagnostics) 1264var overrideReturnType = getNotNullIfNotNullOutputType(overrideMethod.ReturnTypeWithAnnotations, overrideMethod.ReturnNotNullIfParameterNotNull); 1294var baseParameterType = baseParameter.TypeWithAnnotations; 1297var overrideParameterType = getNotNullIfNotNullOutputType(overrideParameter.TypeWithAnnotations, overrideParameter.NotNullIfParameterNotNull); 1324TypeWithAnnotations getNotNullIfNotNullOutputType(TypeWithAnnotations outputType, ImmutableHashSet<string> notNullIfParameterNotNull)
Symbols\Source\SourceMemberFieldSymbol.cs (8)
327internal readonly TypeWithAnnotations Type; 329internal TypeAndRefKind(RefKind refKind, TypeWithAnnotations type) 431internal sealed override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 452TypeWithAnnotations type; 473type = TypeWithAnnotations.Create(tokenTableType.Construct(ImmutableArray.Create(@event.TypeWithAnnotations))); 545type = TypeWithAnnotations.Create(initializerOpt.Type); 554type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 561type = TypeWithAnnotations.Create(new PointerTypeSymbol(type));
Symbols\Source\SourceMemberMethodSymbol.cs (4)
338protected void CheckEffectiveAccessibility(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 372protected void CheckFileTypeUsage(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 798public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 892var unusedType = this.ReturnTypeWithAnnotations;
Symbols\Source\SourceMethodSymbol.cs (1)
23public abstract ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes();
Symbols\Source\SourceNamedTypeSymbol.cs (23)
265internal ImmutableArray<TypeWithAnnotations> GetTypeParameterConstraintTypes(int ordinal) 268return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty; 271private ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 313private ImmutableArray<ImmutableArray<TypeWithAnnotations>> MakeTypeParameterConstraintTypes(BindingDiagnosticBag diagnostics) 507ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 508ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes = null; 509SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap = null; 556static bool mergeConstraints(ImmutableArray<TypeWithAnnotations> originalConstraintTypes, 557ref SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap, ref ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes, 577TypeWithAnnotations.EqualsComparer.IgnoreNullableModifiersForReferenceTypesComparer); 578SmallDictionary<TypeWithAnnotations, int> clauseConstraintTypesMap = toDictionary(clause.ConstraintTypes, originalConstraintTypesMap.Comparer); 582TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1]; 592TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2]; 606mergedConstraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(originalConstraintTypes.Length); 626static SmallDictionary<TypeWithAnnotations, int> toDictionary(ImmutableArray<TypeWithAnnotations> constraintTypes, IEqualityComparer<TypeWithAnnotations> comparer) 628var result = new SmallDictionary<TypeWithAnnotations, int>(comparer); 661ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 694static void mergeConstraints(ref TypeParameterConstraintKind mergedKind, ImmutableArray<TypeWithAnnotations> originalConstraintTypes, TypeParameterConstraintClause clause) 735internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 1865TypeWithAnnotations elementType = elementField.TypeWithAnnotations;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
349return TypeWithAnnotations.Create(type).VisitType(
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (3)
22private TypeWithAnnotations _lazyReturnType; 40protected MethodSymbol? MethodChecks(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 185public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceOrdinaryMethodSymbol.cs (7)
113private (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 136TypeWithAnnotations returnType = signatureBinder.BindType(returnTypeSyntax, diagnostics); 187static void forceMethodTypeParameters(TypeWithAnnotations type, SourceOrdinaryMethodSymbol method, ImmutableArray<TypeParameterConstraintClause> declaredConstraints) 208var parameter0Type = this.Parameters[0].TypeWithAnnotations; 941public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 942=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 1028public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes()
Symbols\Source\SourceParameterSymbol.cs (2)
33TypeWithAnnotations parameterType, 127TypeWithAnnotations newTypeWithModifiers = this.TypeWithAnnotations.WithTypeAndModifiers(newType, newCustomModifiers);
Symbols\Source\SourceParameterSymbolBase.cs (1)
93var type = this.TypeWithAnnotations;
Symbols\Source\SourcePropertyAccessorSymbol.cs (8)
21private TypeWithAnnotations _lazyReturnType; 291var type = associatedProperty.TypeWithAnnotations; 339public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 340=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 345public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 378private TypeWithAnnotations ComputeReturnType(BindingDiagnosticBag diagnostics) 387var type = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, this.GetSyntax()));
Symbols\Source\SourcePropertySymbol.cs (4)
553protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 561private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 567var type = binder.BindType(typeSyntax, diagnostics); 689bool hasTypeDifferences = !TypeWithAnnotations.Equals(implementation.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions);
Symbols\Source\SourcePropertySymbolBase.cs (8)
61private TypeWithAnnotations.Boxed _lazyType; 206TypeWithAnnotations type; 208_lazyType = new TypeWithAnnotations.Boxed(type); 251TypeWithAnnotations overriddenPropertyType = overriddenOrImplementedProperty.TypeWithAnnotations; 262_lazyType = new TypeWithAnnotations.Boxed(type); 365public sealed override TypeWithAnnotations TypeWithAnnotations 1368var type = this.TypeWithAnnotations; 1861protected abstract (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics);
Symbols\Source\SourceSimpleParameterSymbol.cs (4)
18private readonly TypeWithAnnotations _parameterType; 22TypeWithAnnotations parameterType, 34TypeWithAnnotations parameterType, 44public override TypeWithAnnotations TypeWithAnnotations => _parameterType;
Symbols\Source\SourceTypeParameterSymbol.cs (4)
92internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 95return (bounds != null) ? bounds.ConstraintTypes : ImmutableArray<TypeWithAnnotations>.Empty; 264foreach (var constraintType in constraintTypes) 733var 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)
219protected (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BaseMethodDeclarationSyntax declarationSyntax, TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics) 221TypeWithAnnotations returnType; 290protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics); 782public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 783=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\ThisParameterSymbol.cs (2)
140public override TypeWithAnnotations TypeWithAnnotations 141=> TypeWithAnnotations.Create(_containingType, NullableAnnotation.NotAnnotated);
Symbols\Source\TypeParameterConstraintClause.cs (7)
76ImmutableArray<TypeWithAnnotations>.Empty); 80ImmutableArray<TypeWithAnnotations>.Empty); 84ImmutableArray<TypeWithAnnotations> constraintTypes) 104ImmutableArray<TypeWithAnnotations> constraintTypes) 130public readonly ImmutableArray<TypeWithAnnotations> ConstraintTypes; 172foreach (TypeWithAnnotations constraintType in constraintClause.ConstraintTypes) 232foreach (TypeWithAnnotations constraintType in constraintClause.ConstraintTypes)
Symbols\Source\TypeParameterInfo.cs (2)
22public ImmutableArray<ImmutableArray<TypeWithAnnotations>> LazyTypeParameterConstraintTypes; 33LazyTypeParameterConstraintTypes = ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty,
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); 391foreach (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)
1228internal bool DeriveUseSiteInfoFromType(ref UseSiteInfo<AssemblySymbol> result, TypeWithAnnotations type, AllowedRequiredModifierType allowedRequiredModifierType) 1342internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1344foreach (var t in types) 1674foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics)
Symbols\Symbol_Attributes.cs (1)
550var 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) 443internal static TypeWithAnnotations GetTypeOrReturnType(this Symbol symbol) 445TypeWithAnnotations returnType; 487internal static void GetTypeOrReturnType(this Symbol symbol, out RefKind refKind, out TypeWithAnnotations returnType, 530returnType = TypeWithAnnotations.Create((TypeSymbol)symbol);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListConstructor.cs (1)
15SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(parameterType), ordinal: 0, RefKind.None, parameterName));
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
15SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(parameterType), ordinal: 0, RefKind.None, "item"));
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
160internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => GetTypeParametersAsTypeArguments();
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
35public override TypeWithAnnotations TypeWithAnnotations => _interfaceProperty.TypeWithAnnotations;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (2)
59internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
837internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => GetTypeParametersAsTypeArguments();
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
49internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (3)
25protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 29return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 32TypeWithAnnotations.Create(ContainingType.BaseTypeNoUseSiteDiagnostics, NullableAnnotation.Annotated),
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (2)
96protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 100TypeWithAnnotations.Create(isNullableEnabled: true, ContainingType),
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
26TypeWithAnnotations.Create(
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
31protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 35return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Void, location, diagnostics)),
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (2)
80protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 82return (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)
31protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) 37return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 40TypeWithAnnotations.Create(ContainingType, annotation),
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (2)
29protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) 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) 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 (3)
41protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics); 53public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() => ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
89protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 94return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 97TypeWithAnnotations.Create(Binder.GetWellKnownType(compilation, WellKnownType.System_Text_StringBuilder, diagnostics, location), annotation),
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
93protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics)
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (2)
38protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 43return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, location, diagnostics), annotation),
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (4)
107public override TypeWithAnnotations TypeWithAnnotations => ((PropertySymbol)((SourcePropertyAccessorSymbol)ContainingSymbol).AssociatedSymbol).TypeWithAnnotations; 112private SingleInitNullable<TypeWithAnnotations> _lazyParameterType; 120public override TypeWithAnnotations TypeWithAnnotations 136return TypeWithAnnotations.Create(eventTokenType);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
122internal 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; } 392public override TypeWithAnnotations ReturnTypeWithAnnotations => TypeWithAnnotations.Create(_getAwaiterGetResultCall.Type); 444private readonly TypeWithAnnotations _returnType; 446internal ScriptEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType) : 458public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 484new SynthesizedLocal(this, TypeWithAnnotations.Create(_containingType), SynthesizedLocalKind.LoweringTemp), 533private readonly TypeWithAnnotations _returnType; 535internal SubmissionEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType, TypeSymbol submissionArrayType) : 541TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray")); 556public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 576new 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)
209public override TypeWithAnnotations ReturnTypeWithAnnotations 211get { return TypeWithAnnotations.Create(_returnType); } 224public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 226get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (2)
19SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(stringType), ordinal: 0, RefKind.None), 20SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), ordinal: 1, RefKind.None)
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
102internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => [];
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
91public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 101public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Synthesized\SynthesizedInlineArrayAsReadOnlySpanMethod.cs (2)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.In, "buffer"), 18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "length")));
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (2)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.Ref, "buffer"), 18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "length")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefMethod.cs (2)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.Ref, "buffer"), 18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "index")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (2)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.In, "buffer"), 18SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(intType), 1, RefKind.None, "index")));
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefMethod.cs (1)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.Ref, "buffer")));
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefReadOnlyMethod.cs (1)
17this.SetParameters(ImmutableArray.Create<ParameterSymbol>(SynthesizedParameterSymbol.Create(this, TypeWithAnnotations.Create(TypeParameters[0]), 0, RefKind.In, "buffer")));
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (3)
85internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => GetTypeParametersAsTypeArguments(); 251internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<TypeWithAnnotations>.Empty;
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; 155var type = this.TypeWithAnnotations; 242TypeWithAnnotations type, 257TypeWithAnnotations type, 346TypeWithAnnotations type,
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
74internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (3)
189public override TypeWithAnnotations ReturnTypeWithAnnotations 201public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 205return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (6)
57TypeWithAnnotations.Create( 59TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, NoLocation.Singleton, diagnostics)))), 0, RefKind.None, "args")); 155public override TypeWithAnnotations ReturnTypeWithAnnotations 159return TypeWithAnnotations.Create(_returnType); 202public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 203=> 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\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) 80public override TypeWithAnnotations TypeWithAnnotations
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (2)
110internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 112return ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Tuples\TupleErrorFieldSymbol.cs (3)
20private readonly TypeWithAnnotations _type; 43TypeWithAnnotations type, 161internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Tuples\TupleFieldSymbol.cs (2)
129internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 322internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound)
Symbols\Tuples\TupleTypeSymbol.cs (11)
32ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 74static NamedTypeSymbol getTupleUnderlyingType(ImmutableArray<TypeWithAnnotations> elementTypes, CSharpSyntaxNode? syntax, CSharpCompilation compilation, BindingDiagnosticBag? diagnostics) 127internal NamedTypeSymbol WithElementTypes(ImmutableArray<TypeWithAnnotations> newElementTypes) 232private static NamedTypeSymbol ConstructTupleUnderlyingType(NamedTypeSymbol firstTupleType, NamedTypeSymbol? chainedTupleTypeOpt, ImmutableArray<TypeWithAnnotations> elementTypes) 244var chainedTypes = ImmutableArray.Create(elementTypes, (loop - 1) * (ValueTupleRestPosition - 1), ValueTupleRestPosition - 1).Add(TypeWithAnnotations.Create(currentSymbol)); 559public sealed override ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations 909private ImmutableArray<TypeWithAnnotations> _lazyElementTypes; 968public ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 978static ImmutableArray<TypeWithAnnotations> collectTupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 980ImmutableArray<TypeWithAnnotations> elementTypes; 986var 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; 691internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\TypeParameterSymbolExtensions.cs (1)
21foreach (var constraintType in typeParameter1.ConstraintTypesNoUseSiteDiagnostics)
Symbols\TypeSymbol.cs (8)
578public virtual ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations => default(ImmutableArray<TypeWithAnnotations>); 628return TypeWithAnnotations.NeedsNullableAttribute(typeWithAnnotationsOpt: default, typeOpt: this); 635internal abstract TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform); 642private static readonly Func<TypeWithAnnotations, TypeWithAnnotations> s_setUnknownNullability = 2440internal bool Equals(TypeWithAnnotations other)
Symbols\TypeSymbolExtensions.cs (31)
120foreach (var constraintType in constraintTypes) 170public static TypeWithAnnotations GetNullableUnderlyingTypeWithAnnotations(this TypeSymbol type) 378internal static bool IsArrayInterface(this TypeSymbol type, out TypeWithAnnotations typeArgument) 596public static bool TryGetElementTypesWithAnnotationsIfTupleType(this TypeSymbol type, out ImmutableArray<TypeWithAnnotations> elementTypes) 605elementTypes = default(ImmutableArray<TypeWithAnnotations>); 747/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.DefaultType"/> 748/// instead of <see cref="TypeWithAnnotations.Type"/> to avoid early resolution of nullable types</param> 750this TypeWithAnnotations typeWithAnnotationsOpt, 752Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, 830TypeWithAnnotations next; 869(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(fields[i].TypeWithAnnotations, canDigThroughNullable); 900(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(typeArguments[i], canDigThroughNullable); 949static (TypeWithAnnotations, TypeSymbol?) getNextIterationElements(TypeWithAnnotations type, bool canDigThroughNullable) 950=> canDigThroughNullable ? (default(TypeWithAnnotations), type.NullableUnderlyingTypeOrSelf) : (type, null); 952static 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) 979(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(currentPointer.Parameters[i].TypeWithAnnotations, canDigThroughNullable); 1252internal static bool ContainsNativeIntegerWrapperType(this TypeWithAnnotations type) 1595foreach (var arg in type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1952private static bool NormalizeTaskTypesInType(CSharpCompilation compilation, ref TypeWithAnnotations typeWithAnnotations) 1957typeWithAnnotations = TypeWithAnnotations.Create(type, customModifiers: typeWithAnnotations.CustomModifiers); 1970var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1981typeArgumentsBuilder[i] = TypeWithAnnotations.Create(typeArgNormalized, customModifiers: typeWithModifier.CustomModifiers); 2021var elementType = arrayType.ElementTypeWithAnnotations; 2032var pointedAtType = pointerType.PointedAtTypeWithAnnotations; 2044var returnType = funcPtrType.Signature.ReturnTypeWithAnnotations; 2047var paramTypes = ImmutableArray<TypeWithAnnotations>.Empty; 2051var paramsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(funcPtrType.Signature.ParameterCount); 2055var paramType = param.TypeWithAnnotations; 2084this 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 (97)
29internal readonly TypeWithAnnotations Value; 30internal Boxed(TypeWithAnnotations value) 75internal static TypeWithAnnotations Create(bool isNullableEnabled, TypeSymbol typeSymbol, bool isAnnotated = false) 85internal static TypeWithAnnotations Create(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation = NullableAnnotation.Oblivious, ImmutableArray<CustomModifier> customModifiers = default) 108internal TypeWithAnnotations AsAnnotated() 118internal TypeWithAnnotations AsNotAnnotated() 168private static TypeWithAnnotations CreateNonLazyType(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation, ImmutableArray<CustomModifier> customModifiers) 173private static TypeWithAnnotations CreateLazyNullableTypeParameter(CSharpCompilation compilation, TypeWithAnnotations underlying) 178private static TypeWithAnnotations CreateLazySubstitutedType(TypeSymbol substitutedTypeSymbol, ImmutableArray<CustomModifier> customModifiers, TypeParameterSymbol typeParameter) 194public TypeWithAnnotations SetIsAnnotated(CSharpCompilation compilation) 222TypeWithAnnotations makeNullableT() 235private TypeWithAnnotations AsNullableReferenceType() => _extensions.AsNullableReferenceType(this); 236public TypeWithAnnotations AsNotNullableReferenceType() => _extensions.AsNotNullableReferenceType(this); 241internal TypeWithAnnotations MergeEquivalentTypes(TypeWithAnnotations other, VarianceKind variance) 250public TypeWithAnnotations WithModifiers(ImmutableArray<CustomModifier> customModifiers) => 338public bool Equals(TypeWithAnnotations other, TypeCompareKind comparison) 390internal sealed class EqualsComparer : EqualityComparer<TypeWithAnnotations> 402public override int GetHashCode(TypeWithAnnotations obj) 411public override bool Equals(TypeWithAnnotations x, TypeWithAnnotations y) 421internal bool TypeSymbolEquals(TypeWithAnnotations other, TypeCompareKind comparison) => 436public TypeWithAnnotations SubstituteType(AbstractTypeMap typeMap) => 439internal TypeWithAnnotations SubstituteTypeCore(AbstractTypeMap typeMap) 446var newTypeWithModifiers = typeMap.SubstituteType(typeSymbol); 542private bool TypeSymbolEqualsCore(TypeWithAnnotations other, TypeCompareKind comparison) 567public TypeWithAnnotations WithTypeAndModifiers(TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) => 570public TypeWithAnnotations WithType(TypeSymbol typeSymbol) => 590TypeWithAnnotations typeWithAnnotationsOpt, 625private static void AddNullableTransforms(TypeWithAnnotations typeWithAnnotations, ArrayBuilder<byte> transforms) 661public bool ApplyNullableTransforms(byte defaultTransformFlag, ImmutableArray<byte> transforms, ref int position, out TypeWithAnnotations result) 724public TypeWithAnnotations WithTopLevelNonNullability() 735public TypeWithAnnotations SetUnknownNullabilityForReferenceTypes() 763return other is TypeWithAnnotations t && this.Equals(t, TypeCompareKind.ConsiderEverything); 781public static bool operator ==(TypeWithAnnotations? x, TypeWithAnnotations? y) 789public static bool operator !=(TypeWithAnnotations? x, TypeWithAnnotations? y) 795internal bool IsSameAs(TypeWithAnnotations other) 856internal abstract TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type); 857internal abstract TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type); 859internal abstract TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers); 873internal abstract TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers); 875internal abstract bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison); 876internal abstract TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap); 877internal abstract void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics); 907internal override TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers) 914internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) 919internal override TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type) 924internal override TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type) 930internal override bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison) 935internal override TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap) 940internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1012internal override TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers) 1017internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) 1022internal override TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type) 1027internal override TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type) 1033internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1038internal override bool TypeSymbolEquals(TypeWithAnnotations type, TypeWithAnnotations other, TypeCompareKind comparison) 1043internal override TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap) 1062private readonly TypeWithAnnotations _underlying; 1065public LazyNullableTypeParameter(CSharpCompilation compilation, TypeWithAnnotations underlying) 1112internal override TypeWithAnnotations WithModifiers(TypeWithAnnotations type, ImmutableArray<CustomModifier> customModifiers) 1122return TypeWithAnnotations.Create(resolvedType, type.NullableAnnotation, customModifiers: customModifiers); 1128internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) 1132return TypeWithAnnotations.Create(typeSymbol, type.NullableAnnotation, customModifiers: customModifiers); 1138internal override TypeWithAnnotations AsNullableReferenceType(TypeWithAnnotations type) 1143internal override TypeWithAnnotations AsNotNullableReferenceType(TypeWithAnnotations type) 1152internal override TypeWithAnnotations SubstituteType(TypeWithAnnotations type, AbstractTypeMap typeMap) 1159var newUnderlying = _underlying.SubstituteTypeCore(typeMap); 1176internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1188internal 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 (4)
CodeGen\CodeGenTupleTest.cs (3)
28989var obliviousObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Oblivious); 29006var nullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Annotated); 29007var nonNullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.NotAnnotated);
Emit\EmitMetadataTests.cs (1)
1167var type = property.TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Attributes\AttributeTests_Nullable.cs (1)
4209var underlyingType = type.SetUnknownNullabilityForReferenceTypes();
Semantics\CollectionExpressionTests.cs (2)
5100Assert.Equal(CollectionExpressionTypeKind.None, ConversionsBase.GetCollectionExpressionTypeKind(comp, listType, out var elementType)); 30134Assert.Equal(CollectionExpressionTypeKind.CollectionBuilder, ConversionsBase.GetCollectionExpressionTypeKind(comp, collectionType, out var elementType));
Semantics\RecordTests.cs (1)
12491var returnType = method.ReturnTypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
DeclarationTests.cs (2)
308var returnType = method.ReturnTypeWithAnnotations; 351var returnType = method.ReturnTypeWithAnnotations;
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (1)
271var missing = methodSymbol.TypeWithAnnotations;
Symbols\Source\TypeMapTests.cs (1)
156var type = v1.TypeWithAnnotations;
Symbols\SymbolErrorTests.cs (2)
3374var ptype = param.TypeWithAnnotations; 16892var fieldType = fieldSym.TypeWithAnnotations;
Symbols\TypeTests.cs (1)
473var elemType1 = (field1 as FieldSymbol).TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
113var type = TypeWithAnnotations.Create(comp.GetSpecialType(SpecialType.System_Object));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
476var type = TypeWithState.Create(
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdEventTests.cs (1)
3573var eventType = @event.TypeWithAnnotations;