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));
2482 references to TypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (2226)
Binder\Binder.cs (1)
378internal virtual TypeWithAnnotations GetIteratorElementType()
Binder\Binder.IdentifierUsedAsValueFinder.cs (2)
180unboundLambda.HasExplicitReturnType(out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers, 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 ImmutableArray<CustomModifier> refCustomModifiers, out TypeWithAnnotations returnType) 56public override TypeWithAnnotations ParameterTypeWithAnnotations(int index) { throw new ArgumentException(); } // implicitly typed
Binder\Binder.ValueChecks.cs (7)
3347public override TypeWithAnnotations TypeWithAnnotations 3348=> TypeWithAnnotations.Create(_type, NullableAnnotation.NotAnnotated); 4778var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(_compilation, expr.Type, out var elementType); 5701TypeWithAnnotations.Create(elementAccess.Expression.Type), 5710returnType: TypeWithAnnotations.Create(elementAccess.Type), 5741TypeWithAnnotations.Create(inlineArray.Type), 5750returnType: TypeWithAnnotations.Create(resultType),
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
99var result = BindMemberOfType(node, node, name, 0, invoked: false, 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); 402var paramType = parameter.TypeWithAnnotations;
Binder\Binder_Await.cs (1)
621var qualified = BindInstanceMemberAccess(node, node, receiver, name, 0, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), invoked: false, indexed: false, diagnostics);
Binder\Binder_Constraints.cs (10)
122ArrayBuilder<TypeWithAnnotations>? constraintTypes = null; 250constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 257var type = BindTypeOrConstraintKeyword(typeSyntax, diagnostics, out ConstraintContextualKeyword keyword); 348return (TypeParameterConstraintClause.Create(constraints, constraintTypes?.ToImmutableAndFree() ?? ImmutableArray<TypeWithAnnotations>.Empty), syntaxBuilder); 413var constraintTypeBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 418var constraintType = constraintTypes[i]; 449TypeWithAnnotations constraintType, 486TypeWithAnnotations type, 488ArrayBuilder<TypeWithAnnotations> constraintTypes, 554static 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); 1304typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>), 1523parameterTypes: out ImmutableArray<TypeWithAnnotations> parameterTypes, 1689internal bool TryGetCollectionIterationType(SyntaxNode syntax, TypeSymbol collectionType, out TypeWithAnnotations iterationType) 1746var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations); 1866var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2408stackAllocType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 2485var destType = targetElementTypes[i];
Binder\Binder_Crefs.cs (4)
787foreach (TypeWithAnnotations typeArgument in namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1086var typeArgumentsWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arity); 1099var typeArgument = BindType(typeArgumentSyntax, unusedDiagnostics); 1144parameterBuilder.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>), 752var declType = BindVariableTypeWithAnnotations(component.Designation, diagnostics, component.Type.SkipScoped(out _).SkipRef(), ref isConst, out isVar, out alias); 803TypeWithAnnotations declTypeWithAnnotations, 854TypeWithAnnotations declTypeWithAnnotations) 866TypeWithAnnotations declTypeWithAnnotations, 950var fieldType = field.GetFieldType(this.FieldsBeingBound);
Binder\Binder_Expressions.cs (53)
379var type = new PointerTypeSymbol(TypeWithAnnotations.Create(boundStackAlloc.ElementType)); 944var declType = BindVariableTypeWithAnnotations(node.Designation, diagnostics, node.Type.SkipScoped(out _).SkipRef(), ref isConst, out isVar, out alias); 952private BoundExpression BindDeclarationVariablesForErrorRecovery(TypeWithAnnotations declTypeWithAnnotations, VariableDesignationSyntax node, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics) 954declTypeWithAnnotations = declTypeWithAnnotations.HasType ? declTypeWithAnnotations : TypeWithAnnotations.Create(CreateErrorType("var")); 993subExpressions.SelectAsArray(e => TypeWithAnnotations.Create(e.Type)), 1028var elementTypesWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arguments.Count); 1060var elementTypeWithAnnotations = TypeWithAnnotations.Create(boundArgument.Type); 1245TypeWithAnnotations typeWithAnnotations = BindType(node.Type, diagnostics); 1386TypeWithAnnotations typeWithAnnotations = typeofBinder.BindType(typeSyntax, diagnostics, out alias); 1410private void CheckDisallowedAttributeDependentType(TypeWithAnnotations typeArgument, NameSyntax attributeName, BindingDiagnosticBag diagnostics) 1439TypeWithAnnotations typeWithAnnotations = this.BindType(typeSyntax, diagnostics, out alias); 1600TypeWithAnnotations typeWithAnnotations = this.BindType(node.Type, diagnostics, out AliasSymbol alias); 1657default(ImmutableArray<TypeWithAnnotations>); 2599TypeWithAnnotations targetTypeWithAnnotations = this.BindType(node.Type, diagnostics); 2760private BoundExpression BindCastCore(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, bool wasCompilerGenerated, BindingDiagnosticBag diagnostics) 2848var targetElementTypesWithAnnotations = default(ImmutableArray<TypeWithAnnotations>); 2908ImmutableArray<TypeWithAnnotations> targetElementTypesWithAnnotations) 2939private BoundExpression BindExplicitNullableCastFromNonNullable(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, BindingDiagnosticBag diagnostics) 2947TypeWithAnnotations underlyingTargetTypeWithAnnotations = targetTypeWithAnnotations.Type.GetNullableUnderlyingTypeWithAnnotations(); 3190var declType = BindVariableTypeWithAnnotations(designation, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 3239var declType = BindVariableTypeWithAnnotations(declarationExpression, diagnostics, typeSyntax, ref isConst, out isVar, out alias); 3503TypeWithAnnotations parameterTypeWithAnnotations, 3603TypeWithAnnotations paramsElementTypeOpt = result.ParamsElementTypeOpt; 3660void reportUnsafeIfNeeded(MemberResolutionResult<TMember> methodResult, BindingDiagnosticBag diagnostics, BoundExpression argument, TypeWithAnnotations parameterTypeWithAnnotations) 4161var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank); 4190type: GetStackAllocType(node, TypeWithAnnotations.Create(bestType), diagnostics, out bool hasErrors), 4536var elementType = arrayType.ElementTypeWithAnnotations; 4621private TypeSymbol GetStackAllocType(SyntaxNode node, TypeWithAnnotations elementTypeWithAnnotations, BindingDiagnosticBag diagnostics, out bool hasErrors) 5122typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty, 5218var typeWithAnnotations = BindType(node.Type, diagnostics); 6734var finalApplicableCandidates = GetCandidatesPassingFinalValidation(node, overloadResolutionResult, receiverOpt: null, default(ImmutableArray<TypeWithAnnotations>), isExtensionMethodGroup: false, diagnostics); 7623ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations = rightHasTypeArguments ? 7625default(ImmutableArray<TypeWithAnnotations>); 7640var typeArgument = typeArgumentsWithAnnotations[i]; 7668/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, bool, string, SeparatedSyntaxList{TypeSyntax}, ImmutableArray{TypeWithAnnotations}, ImmutableArray{BoundExpression}, BindingDiagnosticBag, string?)"/>. 7743var typeArguments = typeArgumentsSyntax.Count > 0 ? BindTypeArguments(typeArgumentsSyntax, diagnostics) : default(ImmutableArray<TypeWithAnnotations>); 7839ImmutableArray<TypeWithAnnotations> typeArguments, 7913ImmutableArray<TypeWithAnnotations> typeArguments, 8033ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, BindingDiagnosticBag diagnostics) 8095ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8164ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, LookupResult lookupResult, BoundMethodGroupFlags flags, SyntaxNode node, 8326default(ImmutableArray<TypeWithAnnotations>), 8428ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8506typeWithAnnotations: TypeWithAnnotations.Create(type)); 8546ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8628ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 8738ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 10158var finalApplicableCandidates = GetCandidatesPassingFinalValidation(syntax, overloadResolutionResult, receiver, default(ImmutableArray<TypeWithAnnotations>), isExtensionMethodGroup: false, diagnostics); 10910ImmutableArray<TypeWithAnnotations> typeArguments = node.TypeArgumentsOpt; 11237TypeWithAnnotations? returnTypeOverride = null) 11242var returnType = returnTypeOverride ?? methodSymbol.ReturnTypeWithAnnotations; 11322static 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)
85ImmutableArray<TypeWithAnnotations> typeArgs = default(ImmutableArray<TypeWithAnnotations>), 751ImmutableArray<TypeWithAnnotations> typeArguments; 1013ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 2037ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, 2215newArguments[i] = ((OutVariablePendingInference)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType), null); 2226newArguments[i] = ((BoundDiscardExpression)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType));
Binder\Binder_Lambda.cs (6)
49ImmutableArray<TypeWithAnnotations> types = default; 53TypeWithAnnotations returnType = default; 128var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 180var typeOpt = p.Type is not null ? BindType(p.Type, diagnostics) : default; 292private (RefKind, ImmutableArray<CustomModifier> refCustomModifiers, TypeWithAnnotations) BindExplicitLambdaReturnType(TypeSyntax syntax, BindingDiagnosticBag diagnostics) 303var returnType = BindType(syntax, diagnostics);
Binder\Binder_Operators.cs (6)
424var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3451var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 4055TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(operandType)); 4762var targetTypeWithAnnotations = typeExpression.TypeWithAnnotations; 4842TypeWithAnnotations targetTypeWithAnnotations = BindType(possibleType, bindAsTypeDiagnostics, out AliasSymbol alias); 5194TypeWithAnnotations targetTypeWithAnnotations = BindType(node.Right, diagnostics, out alias);
Binder\Binder_Patterns.cs (12)
344declType: TypeWithAnnotations.Create(narrowedType, NullableAnnotation.NotAnnotated), 870TypeWithAnnotations declType = BindType(typeSyntax, diagnostics, out AliasSymbol aliasOpt); 879TypeWithAnnotations declType, 938private TypeWithAnnotations BindRecursivePatternType( 954return TypeWithAnnotations.Create(inputType.StrippedType(), NullableAnnotation.NotAnnotated); 985TypeWithAnnotations declTypeWithAnnotations = BindRecursivePatternType(typeSyntax, inputType, diagnostics, ref hasErrors, out BoundTypeExpression? boundDeclType); 1000positionalClause, declType, ImmutableArray<TypeWithAnnotations>.Empty, permitDesignations, ref hasErrors, patternsBuilder, diagnostics); 1168ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 1369var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation); 1396addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations>.Empty); 1445void addSubpatternsForTuple(ImmutableArray<TypeWithAnnotations> elementTypes) 1568typeArgumentsWithAnnotations: default(ImmutableArray<TypeWithAnnotations>),
Binder\Binder_Query.cs (8)
56var typeRestriction = BindTypeArgument(fromClause.Type, diagnostics); 397var castType = BindTypeArgument(join.Type, diagnostics); 829new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None); 853private UnboundLambda MakeQueryUnboundLambdaWithCast(RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression, TypeSyntax castTypeSyntax, TypeWithAnnotations castType, bool withDependencies) 891return MakeQueryInvocation(node, receiver, receiverIsCheckedForRValue, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), ImmutableArray.Create(arg), diagnostics 904return MakeQueryInvocation(node, receiver, receiverIsCheckedForRValue, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), args, diagnostics 911protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, bool receiverIsCheckedForRValue, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics 924protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, bool receiverIsCheckedForRValue, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
Binder\Binder_Statements.cs (13)
727TypeWithAnnotations declType = BindVariableTypeWithAnnotations(node.Declaration, diagnostics, typeSyntax, ref isConst, isVar: out isVar, alias: out alias); 786private TypeWithAnnotations BindVariableTypeWithAnnotations(CSharpSyntaxNode declarationNode, BindingDiagnosticBag diagnostics, TypeSyntax typeSyntax, ref bool isConst, out bool isVar, out AliasSymbol alias) 799TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax.SkipScoped(out _).SkipRef(), diagnostics, out isVar, out alias); 954TypeWithAnnotations declTypeOpt, 980TypeWithAnnotations declTypeOpt, 1025declTypeOpt = TypeWithAnnotations.Create(initializerType); 1030declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1045declTypeOpt = TypeWithAnnotations.Create(CreateErrorType("var")); 1365TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType)); 1470return op1.SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(inferredType)); 2373var targetElementTypes = default(ImmutableArray<TypeWithAnnotations>); 2547ImmutableArray<TypeWithAnnotations> targetElementTypes) 2858TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias);
Binder\Binder_Symbols.cs (38)
38internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 58private TypeWithAnnotations BindTypeOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 79internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar, out AliasSymbol alias) 303internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null, bool suppressUseSiteDiagnostics = false) 312internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, out AliasSymbol alias, ConsList<TypeSymbol> basesBeingResolved = null) 342return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(GetContainingNamespaceOrNonExtensionType(symbol.Symbol), symbol.Symbol, LookupResultKind.NotATypeOrNamespace, diagnosticInfo)); 410/// stack frames due to their use of large struct like <see cref="TypeWithAnnotations"/>. 468return TypeWithAnnotations.Create( 484return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(tupleTypeSyntax.CloseParenToken), BindTupleType(tupleTypeSyntax, diagnostics, basesBeingResolved)); 530void reportNullableReferenceTypesIfNeeded(SyntaxToken questionToken, TypeWithAnnotations typeArgument = default) 552TypeWithAnnotations typeArgument = BindType(typeArgumentSyntax, diagnostics, basesBeingResolved); 553TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation); 580return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(predefinedType.Keyword), type); 593return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(left, LookupResultKind.NotATypeOrNamespace, diagnostics.Add(ErrorCode.ERR_ColColWithTypeAlias, node.Alias.Location, node.Alias.Identifier.Text))); 602var elementType = BindType(node.ElementType, diagnostics, basesBeingResolved); 610return TypeWithAnnotations.Create(new PointerTypeSymbol(elementType)); 616return TypeWithAnnotations.Create(CreateErrorType()); 620internal static CSDiagnosticInfo? GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(LanguageVersion languageVersion, in TypeWithAnnotations type) 636private TypeWithAnnotations BindArrayType( 643TypeWithAnnotations type = BindType(node.ElementType, diagnostics, basesBeingResolved); 679type = TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(rankSpecifier.CloseBracketToken), array); 690var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(numElements); 702var argumentType = BindType(argumentSyntax.Type, diagnostics, basesBeingResolved); 843return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null)); 869return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol( 877return TypeWithAnnotations.Create(errorResult); 1159private TypeWithAnnotations BindGenericSimpleNamespaceOrTypeOrAliasSymbol( 1265return TypeWithAnnotations.Create(AreNullableAnnotationsEnabled(node.TypeArgumentList.GreaterThanToken), resultType); 1346private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1349var args = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Count); 1358private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1371var arg = typeArgument.Kind() == SyntaxKind.OmittedTypeArgument 1372? TypeWithAnnotations.Create(UnboundArgumentErrorTypeSymbol.Instance) 1381private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1427ImmutableArray<TypeWithAnnotations> typeArguments, 1474ImmutableArray<TypeWithAnnotations> typeArguments, bool invoked, ArrayBuilder<Symbol> members, BindingDiagnosticBag diagnostics) 1621ImmutableArray<TypeWithAnnotations> typeArguments, 1690TypeWithAnnotations 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)
142TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, refKind, returnType, errorLocation, diagnostics);
Binder\ForEachEnumeratorInfo.cs (3)
24public readonly TypeWithAnnotations ElementTypeWithAnnotations; 60TypeWithAnnotations elementType, 109public TypeWithAnnotations ElementTypeWithAnnotations;
Binder\ForEachLoopBinder.cs (15)
194TypeWithAnnotations inferredType; 227TypeWithAnnotations inferredType; 273TypeWithAnnotations iterationVariableType; 307TypeWithAnnotations declType = BindTypeOrVarKeyword(typeSyntax, diagnostics, out isVar, out alias); 311declType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 380iterationVariableType = inferredType.HasType ? inferredType : TypeWithAnnotations.Create(CreateErrorType("var")); 626internal TypeWithAnnotations InferCollectionElementType(BindingDiagnosticBag diagnostics, ExpressionSyntax collectionSyntax) 631GetEnumeratorInfoAndInferCollectionElementType(_syntax, collectionSyntax, ref collectionExpr, isAsync: IsAsync, isSpread: false, diagnostics, out TypeWithAnnotations inferredType, builder: out _); 684out TypeWithAnnotations inferredType, 698inferredType = TypeWithAnnotations.Create(DynamicTypeSymbol.Instance); 706inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax)); 1181builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax)); 1295builder.ElementTypeWithAnnotations = TypeWithAnnotations.Create( 1303TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, syntax)) : 1432var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Binder\InContainerBinder.cs (2)
98internal override TypeWithAnnotations GetIteratorElementType() 104return TypeWithAnnotations.Create(this.Compilation.GetSpecialType(SpecialType.System_Object));
Binder\InMethodBinder.cs (5)
126internal override TypeWithAnnotations GetIteratorElementType() 139var elementType = GetIteratorElementTypeFromReturnType(Compilation, refKind, returnType, errorLocation: null, diagnostics: null); 140return !elementType.IsDefault ? elementType : TypeWithAnnotations.Create(CreateErrorType()); 146internal static TypeWithAnnotations GetIteratorElementTypeFromReturnType(CSharpCompilation compilation, 161return TypeWithAnnotations.Create(objectType);
Binder\Semantics\AccessCheck.cs (1)
235foreach (var typeArg in typeArgs)
Binder\Semantics\BestTypeInferrer.cs (3)
16public static NullableAnnotation GetNullableAnnotation(ArrayBuilder<TypeWithAnnotations> types) 19var example = types.FirstOrDefault(t => t.HasType); 23foreach (var type in types)
Binder\Semantics\Conversions\Conversions.cs (3)
165var collectionTypeKind = GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations); 437TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Object), customModifiers: parameter.TypeWithAnnotations.CustomModifiers), parameter.RefCustomModifiers, 514var sourceAsPointer = new PointerTypeSymbol(TypeWithAnnotations.Create(sourceExpression.ElementType));
Binder\Semantics\Conversions\ConversionsBase.cs (45)
1485if (anonymousFunction.HasExplicitReturnType(out var refKind, refCustomModifiers: out _, out var returnType)) 1654internal static CollectionExpressionTypeKind GetCollectionExpressionTypeKind(CSharpCompilation compilation, TypeSymbol destination, out TypeWithAnnotations elementType) 1706internal static bool IsSpanOrListType(CSharpCompilation compilation, TypeSymbol targetType, WellKnownType spanType, [NotNullWhen(true)] out TypeWithAnnotations elementType) 1826internal bool HasTopLevelNullabilityIdentityConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1858internal bool HasTopLevelNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1878private static bool IsPossiblyNullableTypeTypeParameter(in TypeWithAnnotations typeWithAnnotations) 1889public bool HasAnyNullabilityImplicitConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 1959(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 1976(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2279private delegate Conversion ClassifyConversionFromExpressionDelegate(ConversionsBase conversions, BoundExpression sourceExpression, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2280private delegate Conversion ClassifyConversionFromTypeDelegate(ConversionsBase conversions, TypeWithAnnotations source, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast); 2294(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) 2312(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2365(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool _, ref CompoundUseSiteInfo<AssemblySymbol> u, bool _) => 2384(ConversionsBase conversions, TypeWithAnnotations s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) => 2405ImmutableArray<TypeWithAnnotations> sourceTypes; 2406ImmutableArray<TypeWithAnnotations> destTypes; 2590TypeWithAnnotations elementType = source.ElementTypeWithAnnotations; 2591TypeWithAnnotations argument0 = destinationAgg.TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo); 2601private bool HasImplicitReferenceConversion(TypeWithAnnotations source, TypeWithAnnotations destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3160var typeParameters = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3161var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3162var destinationTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 3176var sourceTypeArgument = sourceTypeArguments[paramIndex]; 3177var destinationTypeArgument = destinationTypeArguments[paramIndex]; 3413bool hasConversion(RefKind refKind, TypeWithAnnotations sourceType, TypeWithAnnotations destinationType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3964var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3971var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3981var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3982var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3991var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0]; 3998bool hasCovariantConversion(TypeWithAnnotations source, TypeWithAnnotations destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 4004bool hasIdentityConversion(TypeWithAnnotations source, TypeWithAnnotations destination) 4027var spanElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)[0];
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (3)
595var voidPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(Compilation.GetSpecialType(SpecialType.System_Void))); 1535[TypeWithAnnotations.Create(candidate.LeftType), TypeWithAnnotations.Create(candidate.RightType)],
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (1)
176[TypeWithAnnotations.Create(candidate.OperandType)],
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (8)
110public readonly TypeWithAnnotations DefinitionParamsElementTypeOpt; 111public readonly TypeWithAnnotations ParamsElementTypeOpt; 127TypeWithAnnotations definitionParamsElementTypeOpt = default, 128TypeWithAnnotations paramsElementTypeOpt = default) 323public static MemberAnalysisResult BadArgumentConversions(ImmutableArray<int> argsToParamsOpt, BitVector badArguments, ImmutableArray<Conversion> conversions, TypeWithAnnotations definitionParamsElementTypeOpt, TypeWithAnnotations paramsElementTypeOpt) 383public static MemberAnalysisResult ExpandedForm(ImmutableArray<int> argsToParamsOpt, ImmutableArray<Conversion> conversions, bool hasAnyRefOmittedArgument, TypeWithAnnotations definitionParamsElementType, TypeWithAnnotations paramsElementType)
Binder\Semantics\OverloadResolution\MethodGroup.cs (4)
19internal ArrayBuilder<TypeWithAnnotations> TypeArguments { get; } 27this.TypeArguments = new ArrayBuilder<TypeWithAnnotations>(); 43ImmutableArray<TypeWithAnnotations> typeArguments, 68ImmutableArray<TypeWithAnnotations> typeArguments,
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (173)
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) 138private readonly ImmutableArray<TypeWithAnnotations> _formalParameterTypes; 147private readonly (TypeWithAnnotations Type, bool FromFunctionType)[] _fixedResults; 148private readonly HashSet<TypeWithAnnotations>[] _exactBounds; 149private readonly HashSet<TypeWithAnnotations>[] _upperBounds; 150private readonly HashSet<TypeWithAnnotations>[] _lowerBounds; 180ImmutableArray<TypeWithAnnotations> formalParameterTypes, 329ImmutableArray<TypeWithAnnotations> formalParameterTypes, 349_fixedResults = new (TypeWithAnnotations, bool)[methodTypeParameters.Length]; 350_exactBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 351_upperBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 352_lowerBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 419var fixedType = _fixedResults[i].Type; 447private ImmutableArray<TypeWithAnnotations> GetResults(out bool inferredFromFunctionType) 467var fixedResultType = _fixedResults[i].Type; 485_fixedResults[i] = (TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(_constructedContainingTypeOfMethod, _methodTypeParameters[i].Name, 0, null, false)), false); 502private bool IsUnfixedTypeParameter(TypeWithAnnotations type) 537private void AddBound(TypeWithAnnotations addedBound, HashSet<TypeWithAnnotations>[] collectedBounds, TypeWithAnnotations methodTypeParameterWithAnnotations) 546collectedBounds[methodTypeParameterIndex] = new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer); 572static (typeParameter, i, self) => self.IsUnfixed(i) ? TypeWithAnnotations.Create(typeParameter) : self._fixedResults[i].Type, 614TypeWithAnnotations target = _formalParameterTypes[arg]; 622private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 650var argumentType = _extensions.GetTypeWithAnnotations(argument); 666TypeWithAnnotations target, 682if (!binder.TryGetCollectionIterationType((ExpressionSyntax)argument.Syntax, targetType.StrippedType(), out TypeWithAnnotations targetElementType)) 702TypeWithAnnotations target, 721private bool MakeExplicitParameterTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 753var destType = destTypes[i]; 871var formalType = _formalParameterTypes[arg]; 877private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 900private void MakeOutputTypeInferences(Binder binder, BoundUnconvertedCollectionExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 907if (!binder.TryGetCollectionIterationType((ExpressionSyntax)argument.Syntax, formalType.Type, out TypeWithAnnotations targetElementType)) 921private void MakeOutputTypeInferences(Binder binder, BoundTupleLiteral argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 946var destType = destTypes[i]; 1369private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1394var sourceType = _extensions.GetTypeWithAnnotations(expression); 1402private bool InferredReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1420var returnType = delegateType.DelegateInvokeMethod.ReturnTypeWithAnnotations; 1426var inferredReturnType = InferReturnType(source, delegateType, ref useSiteInfo); 1475TypeWithAnnotations sourceReturnType = method.ReturnTypeWithAnnotations; 1494var returnType = MethodGroupReturnType(binder, originalMethodGroup, fixedParameters, method.RefKind, isFunctionPointerResolution, ref useSiteInfo, in callingConventionInfo); 1504private TypeWithAnnotations MethodGroupReturnType( 1525TypeWithAnnotations type = default; 1547private void ExplicitParameterTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1602private void ExplicitReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1619if (!anonymousFunction.HasExplicitReturnType(out _, out _, out TypeWithAnnotations anonymousFunctionReturnType)) 1638private void ExactInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1692private bool ExactTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 1707private bool ExactArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1757var sourceElementType = GetSpanOrSZArrayElementType(source); 1758var targetElementType = GetSpanElementType(target); 1766private static TypeWithAnnotations GetSpanElementType(TypeSymbol type) 1772private static TypeWithAnnotations GetSpanOrSZArrayElementType(TypeSymbol type) 1786private void ExactOrBoundsInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1802private bool ExactOrBoundsNullableInference(ExactOrBoundsKind kind, TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1822static bool isNullableOnly(TypeWithAnnotations type) 1826private bool ExactNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1831private bool LowerBoundTupleInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1840ImmutableArray<TypeWithAnnotations> sourceTypes; 1841ImmutableArray<TypeWithAnnotations> targetTypes; 1858private bool ExactConstructedInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1888private bool ExactPointerInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1948var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1949var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1969private void LowerBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2063private bool LowerBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 2078private static TypeWithAnnotations GetMatchingElementType(ArrayTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2132var elementSource = arraySource.ElementTypeWithAnnotations; 2133var elementTarget = GetMatchingElementType(arraySource, target, ref useSiteInfo); 2169var sourceElementType = GetSpanOrSZArrayElementType(source); 2170var targetElementType = GetSpanElementType(target); 2189private bool LowerBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2391var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2392var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2404var sourceTypeArgument = sourceTypeArguments[arg]; 2405var targetTypeArgument = targetTypeArguments[arg]; 2478private void UpperBoundInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2539private bool UpperBoundTypeParameterInference(TypeWithAnnotations source, TypeWithAnnotations target) 2553private bool UpperBoundArrayInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2571var elementTarget = arrayTarget.ElementTypeWithAnnotations; 2572var elementSource = GetMatchingElementType(arrayTarget, source.Type, ref useSiteInfo); 2590private bool UpperBoundNullableInference(TypeWithAnnotations source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2595private bool UpperBoundConstructedInference(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations targetWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2741var sourceTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2742var targetTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2754var sourceTypeArgument = sourceTypeArguments[arg]; 2755var targetTypeArgument = targetTypeArguments[arg]; 2848var withoutNullability = Fix(_compilation, _conversions.WithNullability(false), typeParameter, exact, lower, upper, ref discardedUseSiteInfo).Type; 2860private static (TypeWithAnnotations Type, bool FromFunctionType) Fix( 2864HashSet<TypeWithAnnotations>? exact, 2865HashSet<TypeWithAnnotations>? lower, 2866HashSet<TypeWithAnnotations>? upper, 2881var candidates = new Dictionary<TypeWithAnnotations, TypeWithAnnotations>(EqualsIgnoringDynamicTupleNamesAndNullabilityComparer.Instance); 2886Predicate<TypeWithAnnotations> lowerPredicate; 2931var initialCandidates = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 2956TypeWithAnnotations best = default; 2957foreach (var candidate in initialCandidates) 2959foreach (var candidate2 in initialCandidates) 2998best = TypeWithAnnotations.Create(resultType, best.NullableAnnotation); 3004static bool containsFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 3009static bool containsNonFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 3014static bool isFunctionType(TypeWithAnnotations type, [NotNullWhen(true)] out FunctionTypeSymbol? functionType) 3040private static bool ImplicitConversionExists(TypeWithAnnotations sourceWithAnnotations, TypeWithAnnotations destinationWithAnnotations, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConversionsBase conversions) 3064private TypeWithAnnotations InferReturnType(BoundExpression source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3145var returnType = anonymousFunction.InferReturnType(_conversions, fixedDelegate, ref useSiteInfo, out bool inferredFromFunctionType); 3191public static ImmutableArray<TypeWithAnnotations> InferTypeArgumentsFromReceiverType( 3244public static ImmutableArray<TypeWithAnnotations> InferTypeArgumentsFromFirstArgument( 3309var dest = _formalParameterTypes[0]; 3341private ImmutableArray<TypeWithAnnotations> GetInferredTypeArguments(out bool inferredFromFunctionType) 3343var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_fixedResults.Length); 3363private static void GetAllCandidates(Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, ArrayBuilder<TypeWithAnnotations> builder) 3376Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3377HashSet<TypeWithAnnotations> bounds, 3378Predicate<TypeWithAnnotations>? predicate, 3382foreach (var candidate in bounds) 3389var type = candidate; 3405Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3406TypeWithAnnotations newCandidate, 3409if (candidates.TryGetValue(newCandidate, out TypeWithAnnotations oldCandidate)) 3420Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3421HashSet<TypeWithAnnotations> bounds, 3422Predicate<TypeWithAnnotations>? predicate, 3423ArrayBuilder<TypeWithAnnotations> initialCandidates, 3432foreach (var bound in bounds) 3439foreach (var candidate in initialCandidates) 3445TypeWithAnnotations source; 3446TypeWithAnnotations destination; 3460if (conversions.IncludeNullability && candidates.TryGetValue(bound, out var oldBound)) 3467var newBound = TypeWithAnnotations.Create(oldBound.Type, newAnnotation); 3487Dictionary<TypeWithAnnotations, TypeWithAnnotations> candidates, 3488TypeWithAnnotations oldCandidate, 3489TypeWithAnnotations newCandidate, 3498if (candidates.TryGetValue(oldCandidate, out TypeWithAnnotations latest)) 3509TypeWithAnnotations merged = latest.MergeEquivalentTypes(newCandidate, variance); 3518private sealed class EqualsIgnoringDynamicTupleNamesAndNullabilityComparer : EqualityComparer<TypeWithAnnotations> 3522public override int GetHashCode(TypeWithAnnotations obj) 3527public override bool Equals(TypeWithAnnotations x, TypeWithAnnotations y)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (40)
139ArrayBuilder<TypeWithAnnotations> typeArguments, 175ArrayBuilder<TypeWithAnnotations> typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 187ArrayBuilder<TypeWithAnnotations> typeArguments, 240var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(0); 354ArrayBuilder<TypeWithAnnotations> typeArguments, 430ArrayBuilder<TypeWithAnnotations> typeArguments, 564var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 948if (IsValidParams(_binder, constructor, disallowExpandedNonArrayParams: false, out TypeWithAnnotations definitionElementType)) 1011TypeWithAnnotations definitionParamsElementType, 1060ArrayBuilder<TypeWithAnnotations> typeArguments, 1195if ((options & (Options.IsMethodGroupConversion | Options.DisallowExpandedForm)) == 0 && IsValidParams(_binder, leastOverriddenMember, disallowExpandedNonArrayParams, out TypeWithAnnotations definitionElementType)) 1296public static bool IsValidParams(Binder binder, Symbol member, bool disallowExpandedNonArrayParams, out TypeWithAnnotations definitionElementType) 1324public static bool TryInferParamsCollectionIterationType(Binder binder, TypeSymbol type, out TypeWithAnnotations elementType) 2569TypeWithAnnotations paramsElementTypeOpt, TMember member, out RefKind parameterRefKind) 3220CollectionExpressionTypeKind kind1 = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, t1, out TypeWithAnnotations elementType1); 3221CollectionExpressionTypeKind kind2 = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, t2, out TypeWithAnnotations elementType2); 3248if (type.IsArrayInterface(out TypeWithAnnotations typeArg)) 3292var x = lambda.GetInferredReturnType(ref useSiteInfo, out _); 3743var x = lambda.InferReturnType(Conversions, d1, ref useSiteInfo, out _); 3852out ImmutableArray<TypeWithAnnotations> parameterTypes, 3868internal readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 3872internal EffectiveParameters(ImmutableArray<TypeWithAnnotations> types, ImmutableArray<RefKind> refKinds, int firstParamsElementIndex) 3917var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 4054var types = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 4060TypeWithAnnotations paramsIterationType = default; 4067var type = parameter.TypeWithAnnotations; 4103ArrayBuilder<TypeWithAnnotations> typeArguments, 4181ArrayBuilder<TypeWithAnnotations> typeArguments, 4183TypeWithAnnotations definitionParamsElementType, 4244ArrayBuilder<TypeWithAnnotations> typeArgumentsBuilder, 4248TypeWithAnnotations definitionParamsElementTypeOpt, 4267ImmutableArray<TypeWithAnnotations> typeArguments; 4386static ImmutableArray<TypeWithAnnotations> getAllTypeArguments(TMember member, bool isNewExtensionMember) 4406private ImmutableArray<TypeWithAnnotations> InferMethodTypeArguments<TMember>( 4473return default(ImmutableArray<TypeWithAnnotations>); 4479return default(ImmutableArray<TypeWithAnnotations>); 4485TypeWithAnnotations definitionParamsElementTypeOpt, 4497TypeWithAnnotations paramsElementTypeOpt; 4503paramsElementTypeOpt = TypeWithAnnotations.Create(ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (1)
58private static ImmutableArray<TypeWithAnnotations> GetParameterTypesIncludingReceiver(Symbol symbol)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1369TypeWithAnnotations.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)
479public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 485public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 490public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 496: this(syntax, aliasOpt, null, TypeWithAnnotations.Create(type), hasErrors) 500public 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)
45internal readonly TypeWithAnnotations TypeWithAnnotations; 56TypeWithAnnotations typeWithAnnotations, 109public TypeWithAnnotations GetInferredReturnType(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 123public TypeWithAnnotations GetInferredReturnType(ConversionsBase? conversions, NullableWalker.VariableState? nullableState, NullableWalker.GetterNullResilienceData? getterNullResilienceData, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 153var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 179TypeWithAnnotations returnType, 180ImmutableArray<TypeWithAnnotations> parameterTypes, 197internal static InferredLambdaReturnType InferReturnType(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 204internal static InferredLambdaReturnType InferReturnType(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 214private static InferredLambdaReturnType InferReturnTypeImpl(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> returnTypes, 217var types = ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)>.GetInstance(); 239var bestType = CalculateReturnType(binder, conversions, delegateType, types, isAsync, node, ref useSiteInfo, out bool inferredFromFunctionType); 257private static TypeWithAnnotations CalculateReturnType( 261ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns, 267TypeWithAnnotations bestResultType; 293bestResultType = TypeWithAnnotations.Create(bestType); 305bestResultType = TypeWithAnnotations.Create(bestType); 335return TypeWithAnnotations.Create(resultType); 350return TypeWithAnnotations.Create(taskTypeT.Construct(ImmutableArray.Create(bestResultType))); 355private readonly ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> _builder; 357private BlockReturns(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder) 362public static void GetReturnTypes(ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)> builder, BoundBlock block) 395_builder.Add((node, TypeWithAnnotations.Create(type))); 412TypeWithAnnotations returnType, 416ImmutableArray<TypeWithAnnotations> types, 480public bool HasExplicitReturnType(out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers, out TypeWithAnnotations returnType) 502public TypeWithAnnotations InferReturnType(ConversionsBase conversions, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool inferredFromFunctionType) 512public TypeWithAnnotations ParameterTypeWithAnnotations(int index) { return Data.ParameterTypeWithAnnotations(index); } 595public abstract bool HasExplicitReturnType(out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers, out TypeWithAnnotations returnType); 601public abstract TypeWithAnnotations ParameterTypeWithAnnotations(int index); 654var type = lambda.InferredReturnType.TypeWithAnnotations; 664var type = BindForErrorRecovery().InferredReturnType.TypeWithAnnotations; 677private static TypeWithAnnotations DelegateReturnTypeWithAnnotations(MethodSymbol? invokeMethod, out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers) 690internal (ImmutableArray<RefKind>, ArrayBuilder<ScopedKind>, ImmutableArray<TypeWithAnnotations>, bool) CollectParameterProperties() 694var parameterTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(ParameterCount); 701var type = ParameterTypeWithAnnotations(i); 757if (!HasExplicitReturnType(out var returnRefKind, refCustomModifiers: out _, out var returnType)) 761var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 803returnType = TypeWithAnnotations.Create(Binder.Compilation.GetSpecialType(SpecialType.System_Void)); 821var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers); 926TypeWithAnnotations returnType, 927ImmutableArray<TypeWithAnnotations> parameterTypes, 945var returnType = DelegateReturnTypeWithAnnotations(invokeMethod, out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers); 950private void ValidateUnsafeParameters(BindingDiagnosticBag diagnostics, ImmutableArray<TypeWithAnnotations> targetParameterTypes) 977ImmutableArray<TypeWithAnnotations> parameterTypes, 980bool hasExplicitReturnType = HasExplicitReturnType(out var refKind, out ImmutableArray<CustomModifier> refCustomModifiers, out var returnType); 1000var returnTypes = ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>.GetInstance(); 1015? TypeWithAnnotations.Create(this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)) 1016: TypeWithAnnotations.Create(LambdaSymbol.InferenceFailureReturnType); 1043ImmutableArray<TypeWithAnnotations> parameterTypes, 1045TypeWithAnnotations returnType, 1082public readonly ImmutableArray<TypeWithAnnotations> ParameterTypes; 1086public static readonly ReturnInferenceCacheKey Empty = new ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty, null); 1088private ReturnInferenceCacheKey(ImmutableArray<TypeWithAnnotations> parameterTypes, ImmutableArray<RefKind> parameterRefKinds, NamedTypeSymbol? taskLikeReturnTypeOpt) 1128foreach (var type in ParameterTypes) 1148out ImmutableArray<TypeWithAnnotations> parameterTypes, 1154parameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 1163var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(parameterCount); 1240?? rebind(ReallyInferReturnType(delegateType: null, ImmutableArray<TypeWithAnnotations>.Empty, ImmutableArray<RefKind>.Empty)); 1256ImmutableArray<TypeWithAnnotations> parameterTypes, 1259var returnType = inferredReturnType.TypeWithAnnotations; 1273returnType = TypeWithAnnotations.Create(t); 1490private readonly TypeWithAnnotations _returnType; 1494private readonly ImmutableArray<TypeWithAnnotations> _parameterTypesWithAnnotations; 1506TypeWithAnnotations returnType, 1510ImmutableArray<TypeWithAnnotations> parameterTypesWithAnnotations, 1537public override bool HasExplicitReturnType(out RefKind refKind, out ImmutableArray<CustomModifier> refCustomModifiers, out TypeWithAnnotations returnType) 1616public 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!.Compilation.ImplicitlyTypedVariableInferenceFailedType);
CodeGen\CodeGenerator.cs (1)
176var returnTypeWithAnnotations = _method.ReturnTypeWithAnnotations;
CodeGen\EmitArrayInitializer.cs (1)
647arrayType = arrayType.WithElementType(TypeWithAnnotations.Create(elementType.EnumUnderlyingTypeOrSelf()));
CodeGen\Optimizer.cs (1)
2400public override TypeWithAnnotations TypeWithAnnotations
Compilation\CSharpCompilation.cs (10)
2328var firstType = method.Parameters[0].TypeWithAnnotations; 2462return ArrayTypeSymbol.CreateCSharpArray(this.Assembly, TypeWithAnnotations.Create(elementType, elementNullableAnnotation), rank); 2475return new PointerTypeSymbol(TypeWithAnnotations.Create(elementType, elementNullableAnnotation)); 4209var returnTypeWithAnnotations = TypeWithAnnotations.Create(returnType.EnsureCSharpSymbolOrNull(nameof(returnType)), returnType.NullableAnnotation.ToInternalAnnotation()); 4211type => TypeWithAnnotations.Create(type.EnsureCSharpSymbolOrNull(nameof(parameterTypes)), type.NullableAnnotation.ToInternalAnnotation())); 4259var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(elementTypes.Length); 4265typesBuilder.Add(TypeWithAnnotations.Create(elementType, annotation)); 4303(t, a) => TypeWithAnnotations.Create(t.Type, a.ToInternalAnnotation()))); 4333fields.Add(new AnonymousTypeField(name, location, TypeWithAnnotations.Create(type, nullableAnnotation), RefKind.None, ScopedKind.None));
Compilation\CSharpSemanticModel.cs (2)
4680ImmutableArray<TypeWithAnnotations> typeArguments, 4706ImmutableArray<TypeWithAnnotations> typeArguments,
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)
202foreach (var typeArgument in symbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (12)
412var otherReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(otherReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 414var otherParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 419var otherParamsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(sig.ParameterCount); 537bool isCorrespondingType(TypeWithAnnotations type, TypeWithAnnotations expectedType) 539var otherType = type.WithTypeAndModifiers((TypeSymbol?)this.Visit(type.Type), this.VisitCustomModifiers(type.CustomModifiers)); 708private static void ValidateFunctionPointerParamOrReturn(TypeWithAnnotations type, RefKind refKind, ImmutableArray<CustomModifier> refCustomModifiers, bool allowOut) 754private bool AreTypesEqual(TypeWithAnnotations type, TypeWithAnnotations other) 927var translatedReturnTypeWithAnnotations = sig.ReturnTypeWithAnnotations.WithTypeAndModifiers(translatedReturnType, VisitCustomModifiers(sig.ReturnTypeWithAnnotations.CustomModifiers)); 930var translatedParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 935var 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)
263foreach (var arg in AdaptedMethodSymbol.TypeArgumentsWithAnnotations)
Emitter\Model\MostCommonNullableValueBuilder.cs (1)
74internal void AddValue(TypeWithAnnotations type)
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
498var type = TypeWithAnnotations.Create(@interface);
Emitter\Model\PEModuleBuilder.cs (3)
1713internal SynthesizedAttributeData SynthesizeNullableAttributeIfNecessary(Symbol symbol, byte? nullableContextValue, TypeWithAnnotations type) 1740var byteArrayType = ArrayTypeSymbol.CreateSZArray(byteType.ContainingAssembly, TypeWithAnnotations.Create(byteType)); 1826var 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)
136var 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 (225)
119public readonly TypeWithAnnotations LValueType; 130public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType) 139public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 148LValueType = TypeWithAnnotations.Create(type, annotation); 156public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, VisitResult[] nestedVisitResults) 162internal VisitResult WithLValueType(TypeWithAnnotations lvalueType) 229private ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? _returnTypesOpt; 267private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt; 272/// 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;)"/>. 274private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion 275=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 340private TypeWithAnnotations LvalueResultType 345private void SetLvalueResultType(BoundExpression? expression, TypeWithAnnotations type) 360private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null) 380private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null) 491ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 757TypeWithAnnotations symbolType; 875var type = GetTypeOrReturnTypeWithAnnotations(memberToInitialize); 1062var symbolType = ApplyUnconditionalAnnotations(property.TypeWithAnnotations, symbolAnnotations); 1069var overriddenType = ApplyUnconditionalAnnotations(overriddenProperty.TypeWithAnnotations, overriddenAnnotations); 1801ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 1850ArrayBuilder<(BoundReturnStatement, TypeWithAnnotations)>? returnTypesOpt, 2035if (!_variables.TryGetType(local, out TypeWithAnnotations localType)) 2044if (!_variables.TryGetType(parameter, out TypeWithAnnotations parameterType)) 2343private TypeWithAnnotations VisitLvalueWithAnnotations(BoundExpression node) 2384private static bool ShouldReportNullableAssignment(TypeWithAnnotations type, NullableFlowState state) 2420TypeWithAnnotations targetType, 2493TypeWithAnnotations overriddenType, 2495TypeWithAnnotations overridingType, 2566static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2642TypeWithAnnotations targetType, 2685static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2755TypeWithAnnotations fieldOrPropertyType = GetTypeOrReturnTypeWithAnnotations(member); 2882private TypeWithAnnotations GetTypeOrReturnTypeWithAnnotations(Symbol symbol) 2884var typeWithAnnotations = symbol.GetTypeOrReturnType(); 2911typeWithAnnotations = TypeWithAnnotations.Create(typeWithAnnotations.Type, nullableAnnotation); 2993var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations; 2999private void EnterParameter(ParameterSymbol parameter, TypeWithAnnotations parameterType) 3028var parameterLValueType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 3044internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 3074TryGetReturnType(out TypeWithAnnotations returnType, out FlowAnalysisAnnotations returnAnnotations)) 3133private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 3139var lvalueResultType = LvalueResultType; 3155private bool TryGetReturnType(out TypeWithAnnotations type, out FlowAnalysisAnnotations annotations) 3166var returnType = delegateOrMethod.ReturnTypeWithAnnotations; 3209var type = GetDeclaredLocalResult(local); 3217type = TypeWithAnnotations.Create(node.Type, type.NullableAnnotation); 3572var resultType = ResultType.ToTypeWithAnnotations(compilation); 3671TypeWithAnnotations type = local.TypeWithAnnotations; 3874var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations /*targetElementType*/, TypeSymbol /*targetCollectionType*/, TypeWithState>>.GetInstance(); 3886(TypeWithAnnotations resultTypeWithAnnotations) => convertCollection(node, resultTypeWithAnnotations, elementConversionCompletions); 3895var resultType = TypeWithAnnotations.Create(node.Type); 3902void visitElement(BoundNode element, BoundCollectionExpression node, TypeWithAnnotations targetElementType, ArrayBuilder<Func<TypeWithAnnotations, TypeSymbol, TypeWithState>> elementConversionCompletions) 3994TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeSymbol, TypeWithState>> completions) 4036(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(BoundCollectionExpression node, TypeSymbol collectionType) 4038var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4155(TypeWithAnnotations resultTypeWithAnnotations) => 4235var parameterType = constructor.ParameterTypesWithAnnotations[0]; 4236if (AreNullableAndUnderlyingTypes(type, parameterType.Type, out TypeWithAnnotations underlyingType)) 4523Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4534var type = ApplyLValueAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol), GetObjectInitializerMemberLValueAnnotations(symbol)); 4556Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4690var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4742return GetOrCreatePlaceholderSlot(node, TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated)); 4745private int GetOrCreatePlaceholderSlot(object identifier, TypeWithAnnotations type) 4847var elementType = type switch 4895TypeWithAnnotations inferredType = (bestType is null) 4897: TypeWithAnnotations.Create(bestType); 4936static TypeWithAnnotations getSpanElementType(NamedTypeSymbol namedType) 4943static TypeSymbol setSpanElementType(NamedTypeSymbol namedType, TypeWithAnnotations elementType) 4972internal static TypeWithAnnotations BestTypeForLambdaReturns( 4973ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns, 4996var resultTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(n); 5009TypeWithAnnotations inferredType; 5013var bestTypeWithObliviousAnnotation = TypeWithAnnotations.Create(bestType); 5025inferredType = TypeWithAnnotations.Create(bestType, BestTypeInferrer.GetNullableAnnotation(resultTypes)); 5072TypeWithAnnotations result; 5076result = TypeWithAnnotations.Create(type); 5099TypeWithAnnotations type = expressionType.TryGetInlineArrayElementField()!.TypeWithAnnotations; 5103type = TypeWithAnnotations.Create(((NamedTypeSymbol)node.Type).OriginalDefinition.Construct(ImmutableArray.Create(type))); 5328SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5403TypeWithAnnotations.Create(expr.Type), 5505var targetTypeWithNullability = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 5509targetTypeWithNullability = TypeWithAnnotations.Create(MakeNullableOf(targetTypeWithNullability)); 5882TypeWithAnnotations targetType = VisitLvalueWithAnnotations(leftOperand); 5900targetType = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 5991TypeWithAnnotations.Create(rightType), 6027TypeWithAnnotations explicitType = boundConversion.ConversionGroupOpt?.ExplicitType ?? default; 6029TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(boundConversion.Type); 6168var accessTypeWithAnnotations = LvalueResultType; 6224TypeWithAnnotations consequenceLValue; 6225TypeWithAnnotations alternativeLValue; 6245var refResultTypeWithAnnotations = TypeWithAnnotations.Create(refResultType, lValueAnnotation); 6254SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 6305TypeWithAnnotations resultTypeWithAnnotations; 6326resultTypeWithAnnotations = TypeWithAnnotations.Create(resultType); 6339BoundExpression alternative, Conversion alternativeConversion, bool alternativeEndReachable, TypeWithAnnotations resultTypeWithAnnotations, bool wasTargetTyped) 6396(TypeWithAnnotations resultTypeWithAnnotations) => 6418(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6422TypeWithAnnotations lValueType = VisitLvalueWithAnnotations(operand); 6426void reportMismatchIfNecessary(BoundExpression node, TypeWithAnnotations source, TypeWithAnnotations destination) 6439TypeWithAnnotations targetType, 6487private static BoundExpression CreatePlaceholderIfNecessary(BoundExpression expr, TypeWithAnnotations type) 6585TypeWithAnnotations paramsIterationType = default; 6654var type = TypeWithAnnotations.Create(node.Type); 6880var parameterType = method.Parameters[0].TypeWithAnnotations; 7145private static TypeWithAnnotations ApplyLValueAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations flowAnalysisAnnotations) 7177private static TypeWithAnnotations ApplyUnconditionalAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations annotations) 7388TypeWithAnnotations paramsIterationType = default; 7395(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, bool isExpandedParamsArgument) = 7465TypeWithAnnotations paramsIterationType = default; 7471(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, _) = 7616completion(TypeWithAnnotations.Create(argument.Type)); 7810TypeWithAnnotations paramsIterationType = default; 7820TypeWithAnnotations paramsIterationType = default; 7899TypeWithAnnotations parameterType, 7954var lvalueResultType = result.LValueType; 8036TypeWithAnnotations parameterType, 8066var lValueType = result.LValueType; 8090var declaredType = result.LValueType; 8092var lValueType = ApplyLValueAnnotations(declaredType, leftAnnotations); 8095var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 8149void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 8332private (ParameterSymbol? Parameter, TypeWithAnnotations Type, FlowAnalysisAnnotations Annotations, bool isExpandedParamsArgument) GetCorrespondingParameter( 8337ref TypeWithAnnotations paramsIterationType) 8351var type = parameter.TypeWithAnnotations; 8399parameterTypes: out ImmutableArray<TypeWithAnnotations> parameterTypes, 8482internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 8484return TypeWithAnnotations.Create(expr.GetTypeOrFunctionType(), GetNullableAnnotation(expr)); 8515internal override TypeWithAnnotations GetMethodGroupResultType(BoundMethodGroup group, MethodSymbol method) 8583var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8904TypeWithAnnotations explicitType = node.ConversionGroupOpt?.ExplicitType ?? default; 8906TypeWithAnnotations targetType = fromExplicitCast ? explicitType : TypeWithAnnotations.Create(node.Type); 8944private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8956private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8958TypeWithAnnotations targetTypeOpt, 8970(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8972TypeWithAnnotations targetTypeOpt, 9007Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 9009return (TypeWithAnnotations targetTypeOpt) => 9018private static bool AreNullableAndUnderlyingTypes([NotNullWhen(true)] TypeSymbol? nullableTypeOpt, [NotNullWhen(true)] TypeSymbol? underlyingTypeOpt, out TypeWithAnnotations underlyingTypeWithAnnotations) 9023var typeArg = nullableTypeOpt.GetNullableUnderlyingTypeWithAnnotations(); 9058ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 9415TypeWithAnnotations targetTypeWithNullability, 9436if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 9627if (AreNullableAndUnderlyingTypes(targetType, operandType.Type, out TypeWithAnnotations underlyingType)) 9767static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9783static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9817static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9877foreach (var constraintType in typeParameter1.ConstraintTypesNoUseSiteDiagnostics) 9975TypeWithAnnotations targetTypeWithNullability, 10007TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.FromType), 10027var parameterType = ApplyLValueAnnotations(parameter.TypeWithAnnotations, parameterAnnotations); 10033var underlyingOperandTypeWithAnnotations = operandType.Type.GetNullableUnderlyingTypeWithAnnotations(); 10059var methodReturnType = method.ReturnTypeWithAnnotations; 10078TypeWithAnnotations.Create(conversion.BestUserDefinedConversionAnalysis!.ToType), 10159private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 10180private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 10187private TypeSymbol MakeNullableOf(TypeWithAnnotations underlying) 10194TypeWithAnnotations targetType, 10294(TypeWithAnnotations resultTypeWithAnnotations) => 10375var argTypeWithAnnotations = TypeWithAnnotations.Create(argType, NullableAnnotation.NotAnnotated); 10475var parameterType = parameter.TypeWithAnnotations; 10574var lvalueResult = TypeWithAnnotations.Create(node.Type, NullableAnnotation.NotAnnotated); 10582var parameterType = GetDeclaredParameterResult(parameter); 10602TypeWithAnnotations leftLValueType; 10643var lvalueType = rightState.ToTypeWithAnnotations(compilation); 10661var type = property.TypeWithAnnotations; 10663var lValueType = ApplyLValueAnnotations(type, annotations); 10934var lvalueType = variable.Type; 10986AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType)) 11002internal readonly TypeWithAnnotations Type; 11005internal DeconstructionVariable(BoundExpression expression, TypeWithAnnotations type) 11152var operandLvalue = LvalueResultType; 11167TypeWithAnnotations targetTypeOfOperandConversion; 11183targetTypeOfOperandConversion = TypeWithAnnotations.Create(MakeNullableOf(targetTypeOfOperandConversion)); 11229var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 11336var leftLvalueType = LvalueResultType; 11442private TypeWithAnnotations GetDeclaredLocalResult(LocalSymbol local) 11444return _variables.TryGetType(local, out TypeWithAnnotations type) ? 11449private TypeWithAnnotations GetDeclaredParameterResult(ParameterSymbol parameter) 11451return _variables.TryGetType(parameter, out TypeWithAnnotations type) ? 11500TypeWithAnnotations typeWithAnnotations = GetTypeOrReturnTypeWithAnnotations(updatedProperty); 11616var type = GetTypeOrReturnTypeWithAnnotations(member); 11735TypeWithAnnotations targetTypeWithAnnotations; 11773targetTypeWithAnnotations = TypeWithAnnotations.Create(collectionExpression.Type); 11780targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 11834TypeWithAnnotations.Create(enumeratorInfoOpt.ElementType, NullableAnnotation.NotAnnotated).ToTypeWithState(); 11915TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 11944TypeWithAnnotations destinationType = iterationVariable.TypeWithAnnotations; 12032var type = TypeWithAnnotations.Create(node.Type); 12189var type = TypeWithAnnotations.Create(node.Type); 12197var type = TypeWithAnnotations.Create(node.Type); 12219var type = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 12612var result = TypeWithAnnotations.Create(node.Type); 12632var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 12738var result = TypeWithAnnotations.Create(node.Type, NullableAnnotation.Oblivious); 12807private static bool IsNullabilityMismatch(TypeWithAnnotations type1, TypeWithAnnotations type2) 12909var result = TypeWithAnnotations.Create(node.Type, node.IsInferred ? NullableAnnotation.Annotated : node.NullableAnnotation); 12953TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None, 13006var typeWithAnnotations = TypeWithAnnotations.Create(node.Type, node.NullableAnnotation); 13071var 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; 537var type = property.TypeWithAnnotations; 562TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: false); 574TypeWithAnnotations type = getIndexerOutputType(inputType, e.IndexerAccess, isSlice: true); 686var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 687if (_variables.TryGetType(local, out var existingType)) 690inferredType = TypeWithAnnotations.Create(inferredType.Type, existingType.NullableAnnotation.Join(inferredType.NullableAnnotation)); 833int makeDagTempSlot(TypeWithAnnotations type, BoundDagTemp temp) 841var type = TypeWithAnnotations.Create(t, NullableAnnotation.Annotated); 848static TypeWithAnnotations getIndexerOutputType(TypeSymbol inputType, BoundExpression e, bool isSlice) 856? TypeWithAnnotations.Create(isNullableEnabled: true, inputType, isAnnotated: false) 957var inferredTypeWithAnnotations = TypeWithAnnotations.Create(inferredType); 993TypeWithAnnotations inferredTypeWithAnnotations, 1040(TypeWithAnnotations inferredTypeWithAnnotations) =>
Generated\BoundNodes.xml.Generated.cs (9)
1050public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1066public TypeWithAnnotations TypeWithAnnotations { get; } 1071public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 5839public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false) 5856public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 5864public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type) 6076public 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) 6092public ImmutableArray<TypeWithAnnotations> TypeArgumentsOpt { get; } 6103public 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)
224var pendingExceptionLocal = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax); 226var pendingBranchVar = new SynthesizedLocal(_F.CurrentFunction, TypeWithAnnotations.Create(_F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax); 1082this.returnValue = returnValue = new SynthesizedLocal(containingMethod, TypeWithAnnotations.Create(valueOpt.Type), SynthesizedLocalKind.AsyncMethodReturnValue, _syntaxOpt); 1118this.pendingCaughtException = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Object)), SynthesizedLocalKind.TryAwaitPendingCaughtException, tryStatementSyntax); 1119this.pendingCatch = new SynthesizedLocal(F.CurrentFunction, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingCatch, tryStatementSyntax);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
441typeArgumentsWithAnnotations: ImmutableArray<TypeWithAnnotations>.Empty,
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
70newLocal = new TypeSubstitutedLocalSymbol(local, TypeWithAnnotations.Create(newType), CurrentMethod);
Lowering\ClosureConversion\ClosureConversion.cs (11)
667var frameTypeParameters = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, frame.Arity); 671LocalSymbol framePointer = new SynthesizedLocal(_topLevelMethod, TypeWithAnnotations.Create(frameType), SynthesizedLocalKind.LambdaDisplayClass, frame.ScopeSyntaxOpt); 965private ImmutableArray<TypeWithAnnotations> SubstituteTypeArguments(ImmutableArray<TypeWithAnnotations> typeArguments) 989var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Length); 990foreach (var typeArg in typeArguments) 992TypeWithAnnotations oldTypeArg; 993TypeWithAnnotations newTypeArg = typeArg; 1018ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, 1030var realTypeArguments = ImmutableArray.Create(_currentTypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t)), 0, totalTypeArgumentCount - originalMethod.Arity); 1654RemapLambdaOrLocalFunction(node.Syntax, node.Symbol, default(ImmutableArray<TypeWithAnnotations>), closureKind, ref referencedMethod, out receiver, out constructedFrame);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (6)
23private readonly TypeWithAnnotations _type; 26protected LambdaCapturedVariable(SynthesizedClosureEnvironment frame, TypeWithAnnotations type, string fieldName, bool isThisParameter) 54new LambdaCapturedVariableForRegularParameter(frame, TypeWithAnnotations.Create(type), fieldName, parameter) : 55new LambdaCapturedVariable(frame, TypeWithAnnotations.Create(type), fieldName, isThis); 143internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 178public LambdaCapturedVariableForRegularParameter(SynthesizedClosureEnvironment frame, TypeWithAnnotations type, string fieldName, ParameterSymbol parameter)
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)
228foreach (var typeArgument in method.TypeArgumentsWithAnnotations)
Lowering\LocalRewriter\LocalRewriter.cs (2)
415static bool hasReturnTypeOrParameter(MethodSymbol localFunction, Func<TypeWithAnnotations, bool> predicate) => 844var elementType = ((ArrayTypeSymbol)node.Expression.Type).ElementTypeWithAnnotations;
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
378var operandType = new PointerTypeSymbol(TypeWithAnnotations.Create(_factory.SpecialType(SpecialType.System_Void)));
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
31ImmutableArray<TypeWithAnnotations> typeArguments; 169var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance();
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (9)
44if (ConversionsBase.IsSpanOrListType(_compilation, node.Type, WellKnownType.System_Collections_Generic_List_T, out var listElementType)) 144private bool TryRewriteSingleElementSpreadToList(BoundCollectionExpression node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result) 256var elementType = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 296var elementType = spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 461var elementType = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 601TypeWithAnnotations elementType, 635Construct(ImmutableArray.Create(TypeWithAnnotations.Create(inlineArrayType), elementType)); 664inlineArrayAsSpan = inlineArrayAsSpan.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(inlineArrayType), elementType)); 1091private BoundExpression CreateAndPopulateList(BoundCollectionExpression node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
104var byteArray = ArrayTypeSymbol.CreateSZArray(_compilation.Assembly, TypeWithAnnotations.Create(byteType)); 666TypeWithAnnotations sourceElementType = ((NamedTypeSymbol)sourceType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 687TypeWithAnnotations 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)
519TypeWithAnnotations arrayElementType = arrayType.ElementTypeWithAnnotations;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
168ImmutableArray<TypeWithAnnotations>.Empty,
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
472BoundExpression MakeBoundConversion(BoundExpression expr, Conversion conversion, TypeWithAnnotations type, BoundConversion enclosing)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
197ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations,
Lowering\MethodToClassRewriter.cs (2)
145var visitedTypeArgs = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArgs.Length); 146foreach (var typeArg in typeArgs)
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (6)
23private readonly TypeWithAnnotations _type; 32public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, bool isPublic, bool isThis) 44this(stateMachineType, TypeWithAnnotations.Create(type), name, slotDebugInfo, slotIndex, isPublic) 48public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic) 68internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 93public StateMachineFieldSymbolForRegularParameter(NamedTypeSymbol stateMachineType, TypeWithAnnotations type, string name, ParameterSymbol parameter, bool isPublic)
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
46public override TypeWithAnnotations TypeWithAnnotations
Lowering\SynthesizedMethodBaseSymbol.cs (3)
81public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 82=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 191public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Lowering\SyntheticBoundNodeFactory.cs (11)
170public StateMachineFieldSymbol StateMachineField(TypeWithAnnotations type, string name, bool isPublic = false, bool isThis = false) 181var result = new StateMachineFieldSymbol(CurrentType, TypeWithAnnotations.Create(type), name, isPublic, isThis); 189var result = new StateMachineFieldSymbolForRegularParameter(CurrentType, TypeWithAnnotations.Create(type), name, parameter, isPublic); 608return new SynthesizedLocal(CurrentFunction, TypeWithAnnotations.Create(type), kind, syntax, isPinned, 628TypeWithAnnotations.Create(type), 639return SynthesizedParameterSymbol.Create(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, name); 1241public BoundExpression NullRef(TypeWithAnnotations type) 1292public BoundExpression Typeof(TypeWithAnnotations type, TypeSymbol systemType) 1297public ImmutableArray<BoundExpression> TypeOfs(ImmutableArray<TypeWithAnnotations> typeArguments, TypeSymbol systemType) 1700TypeWithAnnotations.Create(type), 1739temp = 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)
102internal 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)
196var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(nTypeArguments); 230var original = TypeWithAnnotations.Create(genericFieldTypes[index].Type); 232var replacement = TypeWithAnnotations.Create(((ArrayTypeSymbol)lastParam.Type).WithElementType(original));
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
104internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 106get { 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)
61new SynthesizedDelegateInvokeMethod.ParameterDescription(TypeWithAnnotations.Create(typeParams[i]), refKinds.IsNull ? RefKind.None : refKinds[i], ScopedKind.None, defaultValue: null, isParams: false, hasUnscopedRefAttribute: false)); 65var returnType = TypeWithAnnotations.Create(voidReturnTypeOpt ?? typeParams[parameterCount]); 131var type = TypeWithAnnotations.Create(typeParams[i]); 138type = TypeWithAnnotations.Create(ArrayTypeSymbol.CreateSZArray(containingType.ContainingAssembly, type)); 146var returnType = TypeWithAnnotations.Create(returnsVoid ? returnParameter.Type : typeParams[parameterCount]); 207var 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)
259internal 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)
23private readonly TypeWithAnnotations _elementTypeWithAnnotations; 27TypeWithAnnotations elementTypeWithAnnotations, 39TypeWithAnnotations elementTypeWithAnnotations, 51TypeWithAnnotations elementTypeWithAnnotations, 68TypeWithAnnotations elementType, 77TypeWithAnnotations elementTypeWithAnnotations, 84TypeWithAnnotations elementTypeWithAnnotations, 93TypeWithAnnotations elementType) 98internal ArrayTypeSymbol WithElementType(TypeWithAnnotations elementTypeWithAnnotations) 103protected abstract ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations); 106TypeWithAnnotations elementTypeWithAnnotations, 202public TypeWithAnnotations ElementTypeWithAnnotations 394TypeWithAnnotations oldElementType = ElementTypeWithAnnotations; 395TypeWithAnnotations newElementType; 407internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 415TypeWithAnnotations elementType = ElementTypeWithAnnotations.MergeEquivalentTypes(((ArrayTypeSymbol)other).ElementTypeWithAnnotations, variance); 513TypeWithAnnotations elementTypeWithAnnotations, 522protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations newElementType) 571TypeWithAnnotations elementTypeWithAnnotations, 605TypeWithAnnotations elementTypeWithAnnotations, 612protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations) 632TypeWithAnnotations elementTypeWithAnnotations, 645protected override ArrayTypeSymbol WithElementTypeCore(TypeWithAnnotations elementTypeWithAnnotations)
Symbols\AssemblySymbol.cs (4)
780return ArrayTypeSymbol.CreateCSharpArray(this, TypeWithAnnotations.Create(symbol), rank); 790return new PointerTypeSymbol(TypeWithAnnotations.Create(symbol)); 885var typeArgumentSymbols = ArrayBuilder<TypeWithAnnotations>.GetInstance(length); 893typeArgumentSymbols.Add(TypeWithAnnotations.Create(argSymbol));
Symbols\Compilation_WellKnownMembers.cs (3)
807var boolArray = ArrayTypeSymbol.CreateSZArray(booleanType.ContainingAssembly, TypeWithAnnotations.Create(booleanType)); 824var stringArray = ArrayTypeSymbol.CreateSZArray(stringType.ContainingAssembly, TypeWithAnnotations.Create(stringType)); 1028void handle(RefKind refKind, ImmutableArray<CustomModifier> customModifiers, TypeWithAnnotations twa)
Symbols\ConstraintsHelper.cs (32)
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; 900ImmutableArray<TypeWithAnnotations> typeArguments, 951TypeWithAnnotations typeArgument, 1058TypeWithAnnotations typeArgument, 1084var constraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1086ImmutableArray<TypeWithAnnotations> originalConstraintTypes = typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 1098foreach (var constraintType in constraintTypes) 1118static bool errorIfNotSatisfiesConstructorConstraint(Symbol containingSymbol, TypeParameterSymbol typeParameter, TypeWithAnnotations typeArgument, ArrayBuilder<TypeParameterDiagnosticInfo> diagnosticsBuilder) 1144TypeWithAnnotations typeArgument, 1168TypeWithAnnotations typeArgument, 1172TypeWithAnnotations constraintType, 1226static NullableFlowState getTypeArgumentState(in TypeWithAnnotations typeWithAnnotations) 1250foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1265static bool constraintTypeAllows(in TypeWithAnnotations typeWithAnnotations, NullableFlowState state) 1287foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics) 1346TypeWithAnnotations typeArgument, 1347TypeWithAnnotations constraintType, 1396foreach (var typeArgumentConstraint in typeParameter.ConstraintTypesWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1439private static bool IsReferenceType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1444private static bool IsValueType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1633internal static TypeWithAnnotations ConstraintWithMostSignificantNullability(TypeWithAnnotations type1, TypeWithAnnotations type2) 1653internal static bool IsObjectConstraint(TypeWithAnnotations type, ref TypeWithAnnotations bestObjectConstraint) 1679internal 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)
227internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\ErrorMethodSymbol.cs (4)
155public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 157get { return ImmutableArray<TypeWithAnnotations>.Empty; } 165public override TypeWithAnnotations ReturnTypeWithAnnotations 167get { 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)
43internal TypeWithAnnotations Substitute(AbstractTypeMap typeMap) 45return TypeWithAnnotations.Create(typeMap.SubstituteNamedType(this)); 306internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 475protected override NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 668private readonly ImmutableArray<TypeWithAnnotations> _typeArgumentsWithAnnotations; 671public ConstructedErrorTypeSymbol(ErrorTypeSymbol constructedFrom, ImmutableArray<TypeWithAnnotations> typeArgumentsWithAnnotations, TupleExtraData? tupleData = null) : 689internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 728internal 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)
54public abstract TypeWithAnnotations TypeWithAnnotations { get; }
Symbols\Extensions\RewrittenMethodSymbol.cs (5)
35public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 40public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 45internal override TypeWithAnnotations IteratorElementTypeWithAnnotations 49TypeWithAnnotations iteratorElementTypeWithAnnotations = _originalMethod.IteratorElementTypeWithAnnotations; 133public override TypeWithAnnotations TypeWithAnnotations
Symbols\Extensions\SynthesizedExtensionMarker.cs (2)
60protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 62return (TypeWithAnnotations.Create(Binder.GetSpecialType(DeclaringCompilation, SpecialType.System_Void, GetFirstLocation(), diagnostics)),
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)
34TypeWithAnnotations returnType, 37ImmutableArray<TypeWithAnnotations> parameterTypes, 49TypeWithAnnotations returnType, 51ImmutableArray<TypeWithAnnotations> parameterTypes, 61TypeWithAnnotations substitutedReturnType, 62ImmutableArray<TypeWithAnnotations> substitutedParameterTypes, 173internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\FunctionTypeSymbol.cs (2)
179internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\LocalSymbol.cs (2)
65public abstract TypeWithAnnotations TypeWithAnnotations 75public virtual TypeWithAnnotations GetTypeWithAnnotations(SyntaxNode reference, BindingDiagnosticBag diagnostics)
Symbols\MemberSignatureComparer.cs (10)
554TypeWithAnnotations unsubstitutedReturnType1; 559TypeWithAnnotations unsubstitutedReturnType2; 586var returnType1 = SubstituteType(typeMap1, unsubstitutedReturnType1); 587var returnType2 = SubstituteType(typeMap2, unsubstitutedReturnType2); 723private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap? typeMap, HashSet<TypeSymbol> result) 725foreach (var type in types) 764var type1 = SubstituteType(typeMap1, param1.TypeWithAnnotations); 765var type2 = SubstituteType(typeMap2, param2.TypeWithAnnotations); 824internal static TypeWithAnnotations SubstituteType(TypeMap? typeMap, TypeWithAnnotations typeSymbol)
Symbols\MemberSymbolExtensions.cs (9)
53internal static ImmutableArray<TypeWithAnnotations> GetParameterTypes(this Symbol member) 62return ImmutableArray<TypeWithAnnotations>.Empty; 205internal static TMember ConstructIncludingExtension<TMember>(this TMember member, ImmutableArray<TypeWithAnnotations> typeArguments) where TMember : Symbol 248internal static Symbol? GetReducedAndFilteredSymbol(this Symbol member, ImmutableArray<TypeWithAnnotations> typeArguments, TypeSymbol receiverType, CSharpCompilation compilation, bool checkFullyInferred) 356foreach (var parameterType in member.GetParameterTypes()) 444var methodReturnType = method.ReturnTypeWithAnnotations; 450var paramType = param.TypeWithAnnotations; 493var type = property.TypeWithAnnotations; 499var 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)
668public override TypeWithAnnotations ReturnTypeWithAnnotations => Signature.ReturnParam.TypeWithAnnotations; 965public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => IsGenericMethod ? GetTypeParametersAsTypeArguments() : ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (5)
746baseType = (NamedTypeSymbol)NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(decodedType), _handle, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 806typeSymbol = NullableTypeDecoder.TransformType(TypeWithAnnotations.Create(typeSymbol), interfaceImpl, moduleSymbol, accessSymbol: this, nullableContext: this).Type; 1898internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 1902return ImmutableArray<TypeWithAnnotations>.Empty; 3090internal 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, 934public 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)
44private ImmutableArray<TypeWithAnnotations> _lazyDeclaredConstraintTypes; 151private ImmutableArray<TypeWithAnnotations> GetDeclaredConstraintTypes(ConsList<PETypeParameterSymbol> inProgress) 158ImmutableArray<TypeWithAnnotations> declaredConstraintTypes; 168var symbolsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 171TypeWithAnnotations bestObjectConstraint = default; 176TypeWithAnnotations type = GetConstraintTypeOrDefault(moduleSymbol, metadataReader, tokenDecoder, constraintHandle, ref hasUnmanagedModreqPattern); 209foreach (TypeWithAnnotations constraintType in symbolsBuilder) 230declaredConstraintTypes = ImmutableArray<TypeWithAnnotations>.Empty; 265private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymbol, MetadataReader metadataReader, MetadataDecoder tokenDecoder, GenericParameterConstraintHandle constraintHandle, ref bool hasUnmanagedModreqPattern) 303var type = TypeWithAnnotations.Create(typeSymbol); 309private static bool? IsNotNullableFromConstraintType(TypeWithAnnotations constraintType, ConsList<PETypeParameterSymbol> inProgress, out bool isNonNullableValueType) 354ImmutableArray<TypeWithAnnotations> constraintTypes = this.GetDeclaredConstraintTypes(inProgress); 380private static bool? IsNotNullableFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes, ConsList<PETypeParameterSymbol> inProgress, out bool isNonNullableValueType) 386foreach (TypeWithAnnotations constraintType in constraintTypes) 537var symbolsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 544TypeWithAnnotations type = GetConstraintTypeOrDefault(moduleSymbol, metadataReader, tokenDecoder, constraintHandle, ref hasUnmanagedModreqPattern); 616internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 619return (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 (9)
244public abstract TypeWithAnnotations ReturnTypeWithAnnotations { get; } 265public abstract ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations { get; } 273internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 841public virtual TypeWithAnnotations GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter) 864return Construct(typeArguments.SelectAsArray(a => TypeWithAnnotations.Create(a))); 867internal MethodSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 908internal ImmutableArray<TypeWithAnnotations> ParameterTypesWithAnnotations 1110internal virtual TypeWithAnnotations IteratorElementTypeWithAnnotations 1169var 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]; 1033var typeArgument = typeArguments[i]; 1034var otherTypeArgument = otherTypeArguments[i]; 1066foreach (TypeWithAnnotations arg in this.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1080var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1086TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 1087TypeWithAnnotations newTypeArgument; 1106internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 1113var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1119TypeWithAnnotations oldTypeArgument = allTypeArguments[i]; 1120TypeWithAnnotations newTypeArgument = transform(oldTypeArgument); 1133internal NamedTypeSymbol WithTypeArguments(ImmutableArray<TypeWithAnnotations> allTypeArguments) 1150var allTypeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1181ArrayBuilder<TypeWithAnnotations> allTypeArguments) 1202TypeWithAnnotations typeArgumentA = typeArgumentsA[i]; 1203TypeWithAnnotations typeArgumentB = typeArgumentsB[i]; 1205TypeWithAnnotations merged = typeArgumentA.MergeEquivalentTypes(typeArgumentB, typeArgumentVariance); 1311internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsNullFunction = type => !type.HasType; 1313internal static readonly Func<TypeWithAnnotations, bool> TypeWithAnnotationsIsErrorType = type => type.HasType && type.Type.IsErrorType(); 1317ImmutableArray<TypeWithAnnotations> modifiedArguments; 1321modifiedArguments = default(ImmutableArray<TypeWithAnnotations>); 1325modifiedArguments = typeArguments.SelectAsArray(t => TypeWithAnnotations.Create(t)); 1331internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments) 1336internal NamedTypeSymbol Construct(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1373protected virtual NamedTypeSymbol ConstructCore(ImmutableArray<TypeWithAnnotations> typeArguments, bool unbound) 1422foreach (var argument in TypeArgumentsWithDefinitionUseSiteDiagnostics(ref useSiteInfo)) 1428internal ImmutableArray<TypeWithAnnotations> GetAllTypeArguments(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1430ArrayBuilder<TypeWithAnnotations> builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1435internal void GetAllTypeArguments(ArrayBuilder<TypeWithAnnotations> builder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1446internal void GetAllTypeArgumentsNoUseSiteDiagnostics(ArrayBuilder<TypeWithAnnotations> builder) 1465internal ImmutableArray<TypeWithAnnotations> GetTypeParametersAsTypeArguments() 1534foreach (TypeWithAnnotations arg in currentType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics)
Symbols\NativeIntegerTypeSymbol.cs (9)
45internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty; 243internal TypeWithAnnotations SubstituteUnderlyingType(TypeWithAnnotations type) => type.SubstituteType(GetTypeMap()); 356public override TypeWithAnnotations ReturnTypeWithAnnotations => _container.SubstituteUnderlyingType(UnderlyingMethod.ReturnTypeWithAnnotations); 358public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => ImmutableArray<TypeWithAnnotations>.Empty; 447public override TypeWithAnnotations TypeWithAnnotations => _containingType.SubstituteUnderlyingType(_underlyingParameter.TypeWithAnnotations); 500public 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)
21private readonly TypeWithAnnotations _pointedAtType; 27internal PointerTypeSymbol(TypeWithAnnotations pointedAtType) 66public TypeWithAnnotations PointedAtTypeWithAnnotations 256TypeWithAnnotations oldPointedAtType = PointedAtTypeWithAnnotations; 257TypeWithAnnotations newPointedAtType; 269internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform) 277TypeWithAnnotations pointedAtType = PointedAtTypeWithAnnotations.MergeEquivalentTypes(((PointerTypeSymbol)other).PointedAtTypeWithAnnotations, VarianceKind.None); 281internal PointerTypeSymbol WithPointedAtType(TypeWithAnnotations newPointedAtType)
Symbols\PropertySymbol.cs (2)
86public abstract TypeWithAnnotations TypeWithAnnotations { get; } 117internal ImmutableArray<TypeWithAnnotations> ParameterTypesWithAnnotations
Symbols\PublicModel\MethodSymbol.cs (1)
369var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(implementation.Arity);
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 (10)
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)); 257public override TypeWithAnnotations GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter) 291public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 494public override TypeWithAnnotations ReturnTypeWithAnnotations 640public 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)
93internal 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 (20)
180public TypeWithAnnotations Retarget(TypeWithAnnotations underlyingType, RetargetOptions options, NamedTypeSymbol asDynamicIfNoPiaContainingType = null) 515var oldArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 534var newArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldArguments.Count); 536foreach (var arg in oldArguments) 538var newArg = Retarget(arg, RetargetOptions.RetargetPrimitiveTypesByTypeCode); // generic instantiation is a signature 595private bool IsNoPiaIllegalGenericInstantiation(ArrayBuilder<TypeWithAnnotations> oldArguments, ArrayBuilder<TypeWithAnnotations> newArguments, int startOfNonInterfaceArguments) 671foreach (var argument in namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 697TypeWithAnnotations oldElement = type.ElementTypeWithAnnotations; 698TypeWithAnnotations newElement = Retarget(oldElement, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 748TypeWithAnnotations oldPointed = type.PointedAtTypeWithAnnotations; 749TypeWithAnnotations newPointed = Retarget(oldPointed, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 762var newReturn = Retarget(signature.ReturnTypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 766var newParameterTypes = ImmutableArray<TypeWithAnnotations>.Empty; 772var newParameterTypesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(paramCount); 778var newParameterType = Retarget(parameter.TypeWithAnnotations, RetargetOptions.RetargetPrimitiveTypesByTypeCode); 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; } } 131public 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\ExplicitInterfaceHelpers.cs (1)
330var returnType = matchingMemberWithoutReturnTypeComparer.GetTypeOrReturnType();
Symbols\Source\ExtensionGroupingInfo.cs (11)
382ImmutableArray<TypeWithAnnotations> constraintTypes1 = typeParameter1.ConstraintTypesNoUseSiteDiagnostics; 383ImmutableArray<TypeWithAnnotations> constraintTypes2 = typeParameter2.ConstraintTypesNoUseSiteDiagnostics; 390var comparer = TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer; 391var substitutedTypes1 = new HashSet<TypeWithAnnotations>(comparer); 392var substitutedTypes2 = new HashSet<TypeWithAnnotations>(comparer); 401static bool areConstraintTypesSubset(HashSet<TypeWithAnnotations> constraintTypes1, HashSet<TypeWithAnnotations> constraintTypes2, TypeParameterSymbol typeParameter2) 403foreach (TypeWithAnnotations constraintType in constraintTypes1) 414static void substituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap? typeMap, HashSet<TypeWithAnnotations> result) 416foreach (TypeWithAnnotations type in types)
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
400var type = this.TypeWithAnnotations;
Symbols\Source\GlobalExpressionVariable.cs (9)
22private TypeWithAnnotations.Boxed _lazyType; 71internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 85TypeWithAnnotations type; 114type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 128private TypeWithAnnotations SetType(BindingDiagnosticBag diagnostics, TypeWithAnnotations type) 139if (Interlocked.CompareExchange(ref _lazyType, new TypeWithAnnotations.Boxed(type), null) == null) 153internal 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)
14private readonly TypeWithAnnotations _parameterType; 21TypeWithAnnotations parameterType, 36public override TypeWithAnnotations TypeWithAnnotations => _parameterType;
Symbols\Source\LambdaSymbol.cs (13)
25private TypeWithAnnotations _returnType; 48ImmutableArray<TypeWithAnnotations> parameterTypes, 52TypeWithAnnotations returnType) : 66_returnType = !returnType.HasType ? TypeWithAnnotations.Create(ReturnTypeIsBeingInferred) : returnType; 159public override TypeWithAnnotations ReturnTypeWithAnnotations 168internal void SetInferredReturnType(RefKind refKind, TypeWithAnnotations inferredReturnType) 193public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 195get { return ImmutableArray<TypeWithAnnotations>.Empty; } 330ImmutableArray<TypeWithAnnotations> parameterTypes, 363var type = hasExplicitlyTypedParameterList 367: TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(compilation, name: string.Empty, arity: 0, errorInfo: null)); 419public 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)
28private ImmutableArray<ImmutableArray<TypeWithAnnotations>> _lazyTypeParameterConstraintTypes; 30private TypeWithAnnotations.Boxed? _lazyReturnType; 235public override TypeWithAnnotations ReturnTypeWithAnnotations 259TypeWithAnnotations returnType = WithTypeParametersBinder.BindType(returnTypeSyntax.SkipScoped(out _).SkipRef(), diagnostics); 309Interlocked.CompareExchange(ref _lazyReturnType, new TypeWithAnnotations.Boxed(returnType), null); 317public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => GetTypeParametersAsTypeArguments(); 491public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes()
Symbols\Source\ParameterHelpers.cs (7)
41parameterCreationFunc: static (Binder context, Symbol owner, TypeWithAnnotations parameterType, 70var parameterCreationFunc = static (Binder context, Symbol owner, TypeWithAnnotations parameterType, 133parameterCreationFunc: static (Binder binder, FunctionPointerMethodSymbol owner, TypeWithAnnotations parameterType, 177Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 257Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 308var parameterType = withTypeParametersBinder.BindType(parameterSyntax.Type, diagnostics, suppressUseSiteDiagnostics: suppressUseSiteDiagnostics); 838TypeWithAnnotations typeWithAnnotations,
Symbols\Source\SourceClonedParameterSymbol.cs (1)
92public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceComplexParameterSymbol.cs (7)
1618var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(DeclaringCompilation, Type, out TypeWithAnnotations elementTypeWithAnnotations); 1750private readonly TypeWithAnnotations _parameterType; 1755TypeWithAnnotations parameterType, 1769public override TypeWithAnnotations TypeWithAnnotations => _parameterType; 1776private readonly TypeWithAnnotations _parameterType; 1781TypeWithAnnotations parameterType, 1801public override TypeWithAnnotations TypeWithAnnotations => _parameterType;
Symbols\Source\SourceConstructorSymbolBase.cs (5)
21private TypeWithAnnotations _lazyReturnType; 59_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 145public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 146=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 151public sealed override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceCustomEventSymbol.cs (2)
19private readonly TypeWithAnnotations _type; 175public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceDelegateMethodSymbol.cs (24)
21private readonly TypeWithAnnotations _returnType; 25TypeWithAnnotations returnType, 57var returnType = binder.BindType(returnTypeSyntax, diagnostics); 60var voidType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 62var objectType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax)); 63var intPtrType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax)); 85var iAsyncResultType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax)); 86var asyncCallbackType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax)); 153public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 154=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 159public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 214TypeWithAnnotations voidType, 215TypeWithAnnotations objectType, 216TypeWithAnnotations intPtrType, 261TypeWithAnnotations returnType, 354TypeWithAnnotations iAsyncResultType, 355TypeWithAnnotations objectType, 356TypeWithAnnotations asyncCallbackType, 396TypeWithAnnotations iAsyncResultType,
Symbols\Source\SourceDestructorSymbol.cs (5)
17private TypeWithAnnotations _lazyReturnType; 86_lazyReturnType = TypeWithAnnotations.Create(bodyBinder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax)); 115public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 116=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 121public override TypeWithAnnotations ReturnTypeWithAnnotations
Symbols\Source\SourceEnumConstantSymbol.cs (2)
61internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 63return 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)
96public abstract override TypeWithAnnotations TypeWithAnnotations { get; } 379var type = this.TypeWithAnnotations; 699protected static void CopyEventCustomModifiers(EventSymbol eventWithCustomModifiers, ref TypeWithAnnotations type, AssemblySymbol containingAssembly) 814protected TypeWithAnnotations BindEventType(Binder binder, TypeSyntax typeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceFieldLikeEventSymbol.cs (2)
27private readonly TypeWithAnnotations _type; 159public override TypeWithAnnotations TypeWithAnnotations
Symbols\Source\SourceLocalSymbol.cs (21)
39private TypeWithAnnotations.Boxed? _type; 325public override TypeWithAnnotations TypeWithAnnotations 354TypeWithAnnotations declType = this.TypeSyntaxBinder.BindTypeOrVarKeyword(typeSyntax, BindingDiagnosticBag.Discarded, out isVar); 363public override TypeWithAnnotations GetTypeWithAnnotations(SyntaxNode reference, BindingDiagnosticBag diagnostics) 368return TypeWithAnnotations.Create(this.DeclaringCompilation.ImplicitlyTypedVariableUsedInForbiddenZoneType); 380TypeWithAnnotations declType; 425return TypeWithAnnotations.Create(this.DeclaringCompilation.ImplicitlyTypedVariableUsedInForbiddenZoneType); 428TypeWithAnnotations inferredType; 451return TypeWithAnnotations.Create(this.DeclaringCompilation.ImplicitlyTypedVariableUsedInForbiddenZoneType); 463declType = TypeWithAnnotations.Create(DeclaringCompilation.ImplicitlyTypedVariableInferenceFailedType); 476protected virtual TypeWithAnnotations InferTypeOfVarVariable() 484internal void SetTypeWithAnnotations(TypeWithAnnotations newType) 487TypeWithAnnotations? originalType = _type?.Value; 500Interlocked.CompareExchange(ref _type, new TypeWithAnnotations.Boxed(newType), null); 659protected override TypeWithAnnotations InferTypeOfVarVariable() 662return TypeWithAnnotations.Create(initializerOpt?.Type); 740protected override TypeWithAnnotations InferTypeOfVarVariable() 771protected override TypeWithAnnotations InferTypeOfVarVariable() 790return TypeWithAnnotations.Create(_nodeBinder.CreateErrorType()); 833protected override TypeWithAnnotations InferTypeOfVarVariable() 883SetTypeWithAnnotations(TypeWithAnnotations.Create(DeclaringCompilation.ImplicitlyTypedVariableInferenceFailedType));
Symbols\Source\SourceMemberContainerSymbol.cs (13)
4888TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4927TypeWithAnnotations.Create(this), 4936TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Void)), 4980TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Text_StringBuilder)), 4988returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 5043returnType: TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_String)), 5217TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Int32)), 5246TypeWithAnnotations.Create(compilation.GetWellKnownType(WellKnownType.System_Type)), 5307TypeWithAnnotations.Create(this), 5316TypeWithAnnotations.Create(compilation.GetSpecialType(SpecialType.System_Boolean)), 5887builder.AddValue(TypeWithAnnotations.Create(baseType)); 5891builder.AddValue(TypeWithAnnotations.Create(@interface)); 5951AddSynthesizedAttribute(ref attributes, moduleBuilder.SynthesizeNullableAttributeIfNecessary(this, nullableContextValue, TypeWithAnnotations.Create(baseType)));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (12)
794foreach (var parameterType in parameterTypes) 958TypeWithAnnotations overridingMemberType = overridingEvent.TypeWithAnnotations; 959TypeWithAnnotations overriddenMemberType = overriddenEvent.TypeWithAnnotations; 1054TypeWithAnnotations overridingMemberType = overridingProperty.TypeWithAnnotations; 1055TypeWithAnnotations overriddenMemberType = overriddenProperty.TypeWithAnnotations; 1203private bool IsValidOverrideReturnType(Symbol overridingSymbol, TypeWithAnnotations overridingReturnType, TypeWithAnnotations overriddenReturnType, BindingDiagnosticBag diagnostics) 1269var overrideReturnType = getNotNullIfNotNullOutputType(overrideMethod.ReturnTypeWithAnnotations, overrideMethod.ReturnNotNullIfParameterNotNull); 1299var baseParameterType = baseParameter.TypeWithAnnotations; 1302var overrideParameterType = getNotNullIfNotNullOutputType(overrideParameter.TypeWithAnnotations, overrideParameter.NotNullIfParameterNotNull); 1329TypeWithAnnotations getNotNullIfNotNullOutputType(TypeWithAnnotations outputType, ImmutableHashSet<string> notNullIfParameterNotNull)
Symbols\Source\SourceMemberFieldSymbol.cs (8)
338internal readonly TypeWithAnnotations Type; 340internal TypeAndRefKind(RefKind refKind, TypeWithAnnotations type) 442internal sealed override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 463TypeWithAnnotations type; 484type = TypeWithAnnotations.Create(tokenTableType.Construct(ImmutableArray.Create(@event.TypeWithAnnotations))); 556type = TypeWithAnnotations.Create(initializerOpt.Type); 565type = TypeWithAnnotations.Create(binder.CreateErrorType("var")); 572type = TypeWithAnnotations.Create(new PointerTypeSymbol(type));
Symbols\Source\SourceMemberMethodSymbol.cs (4)
350protected void CheckEffectiveAccessibility(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 393protected void CheckFileTypeUsage(TypeWithAnnotations returnType, ImmutableArray<ParameterSymbol> parameters, BindingDiagnosticBag diagnostics) 818public sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 907var unusedType = this.ReturnTypeWithAnnotations;
Symbols\Source\SourceMethodSymbol.cs (1)
26public abstract ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes();
Symbols\Source\SourceNamedTypeSymbol.cs (24)
269internal ImmutableArray<TypeWithAnnotations> GetTypeParameterConstraintTypes(int ordinal) 272return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty; 275private ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 317private ImmutableArray<ImmutableArray<TypeWithAnnotations>> MakeTypeParameterConstraintTypes(BindingDiagnosticBag diagnostics) 512ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 513ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes = null; 514SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap = null; 561static bool mergeConstraints(ImmutableArray<TypeWithAnnotations> originalConstraintTypes, 562ref SmallDictionary<TypeWithAnnotations, int> originalConstraintTypesMap, ref ArrayBuilder<TypeWithAnnotations> mergedConstraintTypes, 582TypeWithAnnotations.EqualsComparer.IgnoreNullableModifiersForReferenceTypesComparer); 583SmallDictionary<TypeWithAnnotations, int> clauseConstraintTypesMap = toDictionary(clause.ConstraintTypes, originalConstraintTypesMap.Comparer); 587TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1]; 597TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2]; 611mergedConstraintTypes = ArrayBuilder<TypeWithAnnotations>.GetInstance(originalConstraintTypes.Length); 619foreach (var constraintType in clauseConstraintTypesMap.Keys) 631static SmallDictionary<TypeWithAnnotations, int> toDictionary(ImmutableArray<TypeWithAnnotations> constraintTypes, IEqualityComparer<TypeWithAnnotations> comparer) 633var result = new SmallDictionary<TypeWithAnnotations, int>(comparer); 666ImmutableArray<TypeWithAnnotations> originalConstraintTypes = constraint.ConstraintTypes; 699static void mergeConstraints(ref TypeParameterConstraintKind mergedKind, ImmutableArray<TypeWithAnnotations> originalConstraintTypes, TypeParameterConstraintClause clause) 740internal sealed override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 1930TypeWithAnnotations elementType = elementField.TypeWithAnnotations;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
349return TypeWithAnnotations.Create(type).VisitType(
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (20)
69TypeWithAnnotations extendedType = extensionParameter.TypeWithAnnotations; 111ImmutableArray<TypeWithAnnotations> typeConstraints = typeParameter.GetConstraintTypes(ConsList<TypeParameterSymbol>.Empty); 118foreach (var typeConstraint in typeConstraints) 173TypeWithAnnotations pointedAtType = pointer.PointedAtTypeWithAnnotations; 242var typeArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 254TypeWithAnnotations typeArgument = typeArguments[i]; 283TypeWithAnnotations elementType = array.ElementTypeWithAnnotations; 314TypeWithAnnotations returnType = signature.ReturnTypeWithAnnotations; 332TypeWithAnnotations parameterType = parameter.TypeWithAnnotations; 433static void appendTypeWithAnnotation(TypeWithAnnotations type, StringBuilder builder) 509ImmutableArray<TypeWithAnnotations> tupleElementTypes = namedType.TupleElementTypesWithAnnotations; 512TypeWithAnnotations elementType = tupleElementTypes[i]; 575ImmutableArray<TypeWithAnnotations> typeArguments = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 664ImmutableArray<TypeWithAnnotations> contraintTypes = typeParam.ConstraintTypesNoUseSiteDiagnostics; 1002TypeWithAnnotations parameterType = parameter.TypeWithAnnotations; 1230ImmutableArray<TypeWithAnnotations> typeArguments = MethodTypeInferrer.InferTypeArgumentsFromReceiverType(extension, receiverValue, compilation, conversions, ref discardedUseSiteInfo); 1237ImmutableArray<TypeWithAnnotations> typeArgsForConstruct = fillNotInferredTypeArguments(extension, typeArguments, out wasExtensionFullyInferred); 1252static ImmutableArray<TypeWithAnnotations> fillNotInferredTypeArguments(NamedTypeSymbol extension, ImmutableArray<TypeWithAnnotations> typeArgs, out bool wasFullyInferred) 1260(t, tp) => t.HasType ? t : TypeWithAnnotations.Create(tp));
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)
115private (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 138TypeWithAnnotations returnType = signatureBinder.BindType(returnTypeSyntax, diagnostics); 189static void forceMethodTypeParameters(TypeWithAnnotations type, SourceOrdinaryMethodSymbol method, ImmutableArray<TypeParameterConstraintClause> declaredConstraints) 211var parameter0Type = this.Parameters[0].TypeWithAnnotations; 987public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 988=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 1074public 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)
96var type = parameter.TypeWithAnnotations;
Symbols\Source\SourcePropertyAccessorSymbol.cs (8)
22private TypeWithAnnotations _lazyReturnType; 292var type = associatedProperty.TypeWithAnnotations; 340public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 341=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty; 346public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 379private TypeWithAnnotations ComputeReturnType(BindingDiagnosticBag diagnostics) 388var type = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, this.GetSyntax()));
Symbols\Source\SourcePropertySymbol.cs (3)
563protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 571private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 577var type = binder.BindType(typeSyntax, diagnostics);
Symbols\Source\SourcePropertySymbolBase.cs (8)
63private TypeWithAnnotations.Boxed _lazyType; 208TypeWithAnnotations type; 210_lazyType = new TypeWithAnnotations.Boxed(type); 253TypeWithAnnotations overriddenPropertyType = overriddenOrImplementedProperty.TypeWithAnnotations; 264_lazyType = new TypeWithAnnotations.Boxed(type); 367public sealed override TypeWithAnnotations TypeWithAnnotations 1395var type = this.TypeWithAnnotations; 1913protected 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)
93internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 96return (bounds != null) ? bounds.ConstraintTypes : ImmutableArray<TypeWithAnnotations>.Empty; 265foreach (var constraintType in constraintTypes) 768var constraintTypes = constraints.IsEmpty ? ImmutableArray<TypeWithAnnotations>.Empty : constraints[Ordinal];
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
129protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics)
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
131protected override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (5)
310protected (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BaseMethodDeclarationSyntax declarationSyntax, TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics) 312TypeWithAnnotations returnType; 381protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics); 1003public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 1004=> ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\SynthesizedSourceOrdinaryMethodSymbol.cs (3)
34protected abstract (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics); 44public sealed override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() => ImmutableArray<ImmutableArray<TypeWithAnnotations>>.Empty;
Symbols\Source\ThisParameterSymbol.cs (2)
150public override TypeWithAnnotations TypeWithAnnotations 151=> TypeWithAnnotations.Create(_containingType, NullableAnnotation.NotAnnotated);
Symbols\Source\TypeParameterConstraintClause.cs (7)
75ImmutableArray<TypeWithAnnotations>.Empty); 79ImmutableArray<TypeWithAnnotations>.Empty); 83ImmutableArray<TypeWithAnnotations> constraintTypes) 103ImmutableArray<TypeWithAnnotations> constraintTypes) 129public readonly ImmutableArray<TypeWithAnnotations> ConstraintTypes; 171foreach (TypeWithAnnotations constraintType in constraintClause.ConstraintTypes) 231foreach (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 (8)
29private TypeWithAnnotations.Boxed _lazyReturnType; 134public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 173public override TypeWithAnnotations GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter) 176var notUsed = OriginalDefinition.GetTypeInferredDuringReduction(reducedFromTypeParameter); 230public sealed override TypeWithAnnotations ReturnTypeWithAnnotations 236var returnType = Map.SubstituteType(OriginalDefinition.ReturnTypeWithAnnotations); 237Interlocked.CompareExchange(ref _lazyReturnType, new TypeWithAnnotations.Boxed(returnType), null); 401foreach (var arg in this.TypeArgumentsWithAnnotations)
Symbols\SubstitutedParameterSymbol.cs (3)
50public override TypeWithAnnotations TypeWithAnnotations 55if (mapOrType is TypeWithAnnotations type) 60TypeWithAnnotations 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)
1240internal bool DeriveUseSiteInfoFromType(ref UseSiteInfo<AssemblySymbol> result, TypeWithAnnotations type, AllowedRequiredModifierType allowedRequiredModifierType) 1354internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1356foreach (var t in types) 1691foreach (var constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics)
Symbols\Symbol_Attributes.cs (1)
554var 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) 430internal static TypeWithAnnotations GetTypeOrReturnType(this Symbol symbol) 432TypeWithAnnotations returnType; 474internal static void GetTypeOrReturnType(this Symbol symbol, out RefKind refKind, out TypeWithAnnotations returnType, 517returnType = 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)
165internal 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)
842internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => GetTypeParametersAsTypeArguments();
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (1)
52internal 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)
81protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) 83return (TypeWithAnnotations.Create(Binder.GetWellKnownType(DeclaringCompilation, WellKnownType.System_Type, diagnostics, Location), NullableAnnotation.NotAnnotated),
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (4)
66protected sealed override (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 71return (ReturnType: TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_Boolean, location, diagnostics)), 74TypeWithAnnotations.Create(ContainingType, annotation), 77TypeWithAnnotations.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\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)
94protected 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)
112public override TypeWithAnnotations TypeWithAnnotations => ((PropertySymbol)((SourcePropertyAccessorSymbol)ContainingSymbol).AssociatedSymbol).TypeWithAnnotations; 117private SingleInitNullable<TypeWithAnnotations> _lazyParameterType; 125public override TypeWithAnnotations TypeWithAnnotations 141return TypeWithAnnotations.Create(eventTokenType);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (2)
126internal override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound) 139var propertyType = _property.TypeWithAnnotations;
Symbols\Synthesized\SynthesizedContainer.cs (1)
96internal 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, 170public override TypeWithAnnotations ReturnTypeWithAnnotations { get; } 176public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 178get { return ImmutableArray<TypeWithAnnotations>.Empty; }
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
99internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => ImmutableArray<TypeWithAnnotations>.Empty;
Symbols\Synthesized\SynthesizedEmbeddedExtensionMarkerNameAttributeSymbol.cs (4)
43return [SynthesizedParameterSymbol.Create(ctor, TypeWithAnnotations.Create(systemStringType), ordinal: 0, RefKind.None, name: "name")]; 98public override TypeWithAnnotations TypeWithAnnotations => _backingField.TypeWithAnnotations; 169public override TypeWithAnnotations ReturnTypeWithAnnotations => _nameProperty.TypeWithAnnotations; 172public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations => [];
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; } 395public override TypeWithAnnotations ReturnTypeWithAnnotations => TypeWithAnnotations.Create(_getAwaiterGetResultCall.Type); 447private readonly TypeWithAnnotations _returnType; 449internal ScriptEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType) : 461public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 487new SynthesizedLocal(this, TypeWithAnnotations.Create(_containingType), SynthesizedLocalKind.LoweringTemp), 537private readonly TypeWithAnnotations _returnType; 539internal SubmissionEntryPoint(NamedTypeSymbol containingType, TypeWithAnnotations returnType, TypeSymbol submissionArrayType) : 545TypeWithAnnotations.Create(submissionArrayType), 0, RefKind.None, "submissionArray")); 560public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType; 580new 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)
53var typeWithAnnotations = this.TypeWithAnnotations; 89internal abstract override TypeWithAnnotations GetFieldType(ConsList<FieldSymbol> fieldsBeingBound);
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (4)
211public override TypeWithAnnotations ReturnTypeWithAnnotations 213get { return TypeWithAnnotations.Create(_returnType); } 226public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 228get { 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)
118internal 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)
90internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics => GetTypeParametersAsTypeArguments(); 260internal 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)
225public override TypeWithAnnotations ReturnTypeWithAnnotations 229return TypeWithAnnotations.Create(_returnType); 239public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations 243return ImmutableArray<TypeWithAnnotations>.Empty; 471) : 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; 153var type = this.TypeWithAnnotations; 242TypeWithAnnotations type, 259TypeWithAnnotations type, 350TypeWithAnnotations type,
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
79internal 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")); 160public override TypeWithAnnotations ReturnTypeWithAnnotations 164return TypeWithAnnotations.Create(_returnType); 207public override ImmutableArray<ImmutableArray<TypeWithAnnotations>> GetTypeParameterConstraintTypes() 208=> 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) 88public 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)
31ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations, 73static NamedTypeSymbol getTupleUnderlyingType(ImmutableArray<TypeWithAnnotations> elementTypes, CSharpSyntaxNode? syntax, CSharpCompilation compilation, BindingDiagnosticBag? diagnostics) 126internal NamedTypeSymbol WithElementTypes(ImmutableArray<TypeWithAnnotations> newElementTypes) 231private static NamedTypeSymbol ConstructTupleUnderlyingType(NamedTypeSymbol firstTupleType, NamedTypeSymbol? chainedTupleTypeOpt, ImmutableArray<TypeWithAnnotations> elementTypes) 243var chainedTypes = ImmutableArray.Create(elementTypes, (loop - 1) * (ValueTupleRestPosition - 1), ValueTupleRestPosition - 1).Add(TypeWithAnnotations.Create(currentSymbol)); 558public sealed override ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations 908private ImmutableArray<TypeWithAnnotations> _lazyElementTypes; 967public ImmutableArray<TypeWithAnnotations> TupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 977static ImmutableArray<TypeWithAnnotations> collectTupleElementTypesWithAnnotations(NamedTypeSymbol tuple) 979ImmutableArray<TypeWithAnnotations> elementTypes; 985var typesBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(ValueTupleRestPosition - 1 + extensionTupleElementTypes.Length);
Symbols\TypeMap.cs (21)
23public static readonly Func<TypeWithAnnotations, TypeSymbol> AsTypeSymbol = t => t.Type; 25internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 27return typeParameters.SelectAsArray(static (tp) => TypeWithAnnotations.Create(tp)); 30internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithIgnoredAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 32return typeParameters.SelectAsArray(static (tp) => TypeWithAnnotations.Create(tp, NullableAnnotation.Ignored)); 35internal static ImmutableArray<TypeSymbol> AsTypeSymbols(ImmutableArray<TypeWithAnnotations> typesOpt) 41internal TypeMap(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to, bool allowAlpha = false) 55private TypeMap(SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> mapping) 56: base(new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(mapping, ReferenceEqualityComparer.Instance)) 61private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ForType(NamedTypeSymbol containingType) 65new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(substituted.TypeSubstitution.Mapping, ReferenceEqualityComparer.Instance) : 66new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 69internal TypeMap(NamedTypeSymbol containingType, ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments) 75TypeWithAnnotations ta = typeArguments[i]; 83private static readonly SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> s_emptyDictionary = 84new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 130result.Mapping.Add(tp, TypeWithAnnotations.Create(newTp)); 194private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ConstructMapping(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to) 196var mapping = new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 203TypeWithAnnotations ta = to[i];
Symbols\TypeParameterBounds.cs (2)
24ImmutableArray<TypeWithAnnotations> constraintTypes, 50public readonly ImmutableArray<TypeWithAnnotations> ConstraintTypes;
Symbols\TypeParameterSymbol.cs (14)
83internal ImmutableArray<TypeWithAnnotations> ConstraintTypesNoUseSiteDiagnostics 92internal ImmutableArray<TypeWithAnnotations> ConstraintTypesWithDefinitionUseSiteDiagnostics(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 98foreach (var constraint in result) 384internal abstract ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress); 437internal static bool CalculateIsReferenceTypeFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 439foreach (var constraintType in constraintTypes) 449internal static bool? IsNotNullableFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 454foreach (TypeWithAnnotations constraintType in constraintTypes) 470internal static bool? IsNotNullableFromConstraintType(TypeWithAnnotations constraintType, out bool isNonNullableValueType) 507internal static bool CalculateIsValueTypeFromConstraintTypes(ImmutableArray<TypeWithAnnotations> constraintTypes) 509foreach (var constraintType in constraintTypes) 556ImmutableArray<TypeWithAnnotations> constraintTypes = this.ConstraintTypesNoUseSiteDiagnostics; 692internal 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 = 2452internal bool Equals(TypeWithAnnotations other)
Symbols\TypeSymbolExtensions.cs (32)
121foreach (var constraintType in constraintTypes) 171public static TypeWithAnnotations GetNullableUnderlyingTypeWithAnnotations(this TypeSymbol type) 384internal static bool IsArrayInterface(this TypeSymbol type, out TypeWithAnnotations typeArgument) 602public static bool TryGetElementTypesWithAnnotationsIfTupleType(this TypeSymbol type, out ImmutableArray<TypeWithAnnotations> elementTypes) 611elementTypes = default(ImmutableArray<TypeWithAnnotations>); 758/// <param name="useDefaultType">If true, use <see cref="TypeWithAnnotations.DefaultType"/> 759/// instead of <see cref="TypeWithAnnotations.Type"/> to avoid early resolution of nullable types</param> 761this TypeWithAnnotations typeWithAnnotationsOpt, 763Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, 841TypeWithAnnotations next; 881(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(fields[i].TypeWithAnnotations, canDigThroughNullable); 912(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(typeArguments[i], canDigThroughNullable); 961static (TypeWithAnnotations, TypeSymbol?) getNextIterationElements(TypeWithAnnotations type, bool canDigThroughNullable) 962=> canDigThroughNullable ? (default(TypeWithAnnotations), type.NullableUnderlyingTypeOrSelf) : (type, null); 964static 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) 991(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(currentPointer.Parameters[i].TypeWithAnnotations, canDigThroughNullable); 1264internal static bool ContainsNativeIntegerWrapperType(this TypeWithAnnotations type) 1607foreach (var arg in type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics) 1963private static bool NormalizeTaskTypesInType(CSharpCompilation compilation, ref TypeWithAnnotations typeWithAnnotations) 1968typeWithAnnotations = TypeWithAnnotations.Create(type, customModifiers: typeWithAnnotations.CustomModifiers); 1981var typeArgumentsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(); 1986var typeWithModifier = typeArgumentsBuilder[i]; 1992typeArgumentsBuilder[i] = TypeWithAnnotations.Create(typeArgNormalized, customModifiers: typeWithModifier.CustomModifiers); 2032var elementType = arrayType.ElementTypeWithAnnotations; 2043var pointedAtType = pointerType.PointedAtTypeWithAnnotations; 2055var returnType = funcPtrType.Signature.ReturnTypeWithAnnotations; 2058var paramTypes = ImmutableArray<TypeWithAnnotations>.Empty; 2062var paramsBuilder = ArrayBuilder<TypeWithAnnotations>.GetInstance(funcPtrType.Signature.ParameterCount); 2066var paramType = param.TypeWithAnnotations; 2095this 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)
265foreach (TypeWithAnnotations constraintType in typeParameter.ConstraintTypesNoUseSiteDiagnostics)
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
39public override TypeWithAnnotations TypeWithAnnotations
Utilities\TypeSymbolExtensions.cs (8)
57ImmutableArray<TypeWithAnnotations> typeArgs = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 59foreach (TypeWithAnnotations typeArg in typeArgs) 75static int customModifierCountForTypeWithAnnotations(TypeWithAnnotations typeWithAnnotations) 100TypeWithAnnotations elementType = array.ElementTypeWithAnnotations; 107TypeWithAnnotations pointedAtType = pointer.PointedAtTypeWithAnnotations; 138ImmutableArray<TypeWithAnnotations> typeArgs = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics; 140foreach (TypeWithAnnotations typeArg in typeArgs) 157static bool checkTypeWithAnnotations(TypeWithAnnotations typeWithAnnotations, bool flagNonDefaultArraySizesOrLowerBounds)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (31)
CodeGen\CodeGenDeconstructTests.cs (2)
5607var xType = xSymbol.GetSymbol<FieldSymbol>().TypeWithAnnotations; 6047IDiscardSymbol symbolClone = new DiscardSymbol(TypeWithAnnotations.Create(symbol.Type.GetSymbol())).GetPublicSymbol();
CodeGen\CodeGenFunctionPointersTests.cs (17)
868var returnTypeWithAnnotations = ((FunctionPointerTypeSymbol)m.ReturnType).Signature.ReturnTypeWithAnnotations; 7671CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7672returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7675CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7676parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7680CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string, customModifiers: ImmutableArray.Create(testMod)), refCustomModifiers: default, 7681parameterRefCustomModifiers: default, returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7684CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: ImmutableArray.Create(testMod), 7685parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7756CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7757returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7760CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: default, 7761returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7765CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string, customModifiers: ImmutableArray.Create(testMod)), refCustomModifiers: default, 7766returnRefKind: RefKind.None, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, 7769CallingConvention.Unmanaged, TypeWithAnnotations.Create(@string), refCustomModifiers: ImmutableArray.Create(testMod), 7770returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
CodeGen\CodeGenTupleTest.cs (11)
951var partialParamType = partialNamesMethod.Parameters.Single().TypeWithAnnotations; 957var allNullParamType = allNullNamesMethod.Parameters.Single().TypeWithAnnotations; 13700Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 13756Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 13817Add(TypeWithAnnotations.Create(NamedTypeSymbol.CreateTuple(m1Tuple, 29001var obliviousObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Oblivious); 29018var nullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.Annotated); 29019var nonNullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.NotAnnotated);
Emit\EmitMetadataTests.cs (1)
1168var type = property.TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (23)
Attributes\AttributeTests.cs (14)
5494var typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW)); 5499typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW), rank: 2); 5504typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classW)); 5505typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2); 5510NamedTypeSymbol classYOfW = classY.ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(classW))); 5511typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(classYOfW), rank: 2); 5512typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg)); 5517NamedTypeSymbol classYOfInt = classY.ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(m.ContainingAssembly.GetSpecialType(SpecialType.System_Int32)))); 5519typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(substNestedF), rank: 3); 5520typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg)); 5521typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2); 5526NamedTypeSymbol substNestedZ = classYOfInt.GetTypeMember("Z").ConstructIfGeneric(ImmutableArray.Create(TypeWithAnnotations.Create(classW))); 5527typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(substNestedZ)); 5528typeArg = ArrayTypeSymbol.CreateCSharpArray(m.ContainingAssembly, TypeWithAnnotations.Create(typeArg), rank: 2);
Attributes\AttributeTests_NativeInteger.cs (1)
1064static TypeWithAnnotations getConstraintType(NamedTypeSymbol type) => type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0];
Attributes\AttributeTests_Nullable.cs (3)
4200private static void VerifyBytes(TypeWithAnnotations type, byte[] expectedPreviously, byte[] expectedNow, string expectedDisplay) 4209var underlyingType = type.SetUnknownNullabilityForReferenceTypes(); 4212TypeWithAnnotations updated;
Attributes\AttributeTests_Tuples.cs (1)
280foreach (var parameterType in methodSymbol.ParameterTypesWithAnnotations)
Semantics\CollectionExpressionTests.cs (2)
6109Assert.Equal(CollectionExpressionTypeKind.None, ConversionsBase.GetCollectionExpressionTypeKind(comp, listType, out var elementType)); 32381Assert.Equal(CollectionExpressionTypeKind.CollectionBuilder, ConversionsBase.GetCollectionExpressionTypeKind(comp, collectionType, out var elementType));
Semantics\RecordTests.cs (2)
12551var returnType = method.ReturnTypeWithAnnotations; 12558var parameterType = method.Parameters[0].TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (117)
Semantics\DelegateTypeTests.cs (5)
15666var funcOfObjectNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(objectType, NullableAnnotation.Annotated))); 15667var funcOfStringNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.Annotated))); 15668var funcOfStringNotNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.NotAnnotated))); 15684var setNotNullable = (TypeWithAnnotations type) => TypeWithAnnotations.Create(type.Type, NullableAnnotation.NotAnnotated);
Semantics\InterpolationTests.cs (1)
7748var substitutedC = c.WithTypeArguments(ImmutableArray.Create(TypeWithAnnotations.Create(handler)));
Semantics\NativeIntegerTests.cs (3)
596void verifyTypes(TypeWithAnnotations fromMember, TypeWithAnnotations fromUnderlyingMember) 608bool containsType(TypeWithAnnotations type, bool useNativeInteger)
Semantics\NullableReferenceTypesTests.cs (98)
8812TypeWithAnnotations getParameterType(CSharpCompilation c) => c.GetMember<MethodSymbol>("A.F").Parameters[0].TypeWithAnnotations; 8982void verifyTuple(TypeWithAnnotations type) 9025var constraintType = baseType.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 9051var typeArg = interfaceType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 10357var typeArg = ((NamedTypeSymbol)method.ReturnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0]; 11205var type = method.ReturnTypeWithAnnotations; 11308var type = method.ReturnTypeWithAnnotations; 13212Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 13330var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13338var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13417var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 13692Assert.False(m1.Parameters[0].TypeWithAnnotations.Equals(m1.OverriddenMethod.ConstructIfGeneric(m1.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14032Assert.False(member.ReturnTypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14037Assert.True(m3.ReturnTypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations, 14139Assert.False(member.Parameters[0].TypeWithAnnotations.Equals(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 14144Assert.True(m3.Parameters[0].TypeWithAnnotations.Equals(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations, 16507var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 16515var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17737var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17745var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17805var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17813var implemented = member.ConstructIfGeneric(implementing.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 17881var m1Def = m1.ConstructIfGeneric(m1Impl.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))); 35014Assert.Equal(expectedType, symbol.TypeWithAnnotations.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 35032Assert.Equal(expectedType, symbol.TypeWithAnnotations.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 59412var type = symbol.TypeWithAnnotations; 112731var constraintType = type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0]; 112820var constraintType = type.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics[0]; 113239m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Annotated))), 113240m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.NotAnnotated))), 113241m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Oblivious))) 113246m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Annotated))), 113247m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.NotAnnotated))), 113248m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.Oblivious))) 115921var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 115933var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115963var i1 = iDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115972var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 115984var i2b = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115989var i2c = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i2.TypeParameters.Single(), NullableAnnotation.Annotated))); 115993var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115998var i3b = i3.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i3.TypeParameters.Single(), NullableAnnotation.Annotated))); 116004var c4 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), customModifiers: modifiers))); 145507Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145547Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145587Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145626Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145664Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145697Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145730Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145767Assert.Equal("Extension<object>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145806Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 145895Assert.Equal(new[] { "I<object>", "I<object!>" }, interfaces.Select(i => i.ToDisplayString(TypeWithAnnotations.TestDisplayFormat))); 146076Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 146107Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 146140Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 150151var parameterType = method.Parameters[0].TypeWithAnnotations; 158106i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158108i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158140i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158142i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158178i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158180i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158206i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158208i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158238i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158240i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158246Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158249Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158282Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158377Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158407i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158409i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158415Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158418Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158448i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158450i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158458Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158488i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158490i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158499Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158534Assert.Equal("object", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158567Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158662Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158668Assert.Equal("object", ((IMethodSymbol)found).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158702i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158704i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158710Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158744i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158746i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158754Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158791Assert.Equal("object!", ((IPropertySymbol)found).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 158825i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158827i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158857i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158859i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158891i3.Interfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat)); 158893i3.AllInterfaces().ToTestDisplayStrings(TypeWithAnnotations.TestDisplayFormat));
Semantics\OperatorTests.cs (2)
3272private static string FormatTypeArgumentList(ImmutableArray<TypeWithAnnotations>? arguments) 3299let typeArguments = node["typeArgumentsOpt"].Value as ImmutableArray<TypeWithAnnotations>?
Semantics\RawInterpolationTests_Handler.cs (1)
5906var substitutedC = c.WithTypeArguments(ImmutableArray.Create(TypeWithAnnotations.Create(handler)));
Semantics\UnsafeTests.cs (7)
7853var structPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(structType)); 8166var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 8233var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 8291var intPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(intType)); 10220var charPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(charSymbol)); 10292var charPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(charSymbol)); 10294var voidPointerSymbol = new PointerTypeSymbol(TypeWithAnnotations.Create(voidSymbol));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (74)
DeclarationTests.cs (2)
308var returnType = method.ReturnTypeWithAnnotations; 351var returnType = method.ReturnTypeWithAnnotations;
SymbolDisplay\SymbolDisplayTests.cs (1)
6543var type = method.GetSymbol<MethodSymbol>().ReturnTypeWithAnnotations;
Symbols\CompilationCreationTests.cs (1)
97var arrayOfc107 = ArrayTypeSymbol.CreateCSharpArray(c1.Assembly, TypeWithAnnotations.Create(c107));
Symbols\CorLibrary\CorTypes.cs (1)
43var p = noMsCorLibRef.GlobalNamespace.GetTypeMembers("I1").Single().
Symbols\CustomModifiersTests.cs (2)
2482var t1 = test1.Parameters[0].TypeWithAnnotations; 2483var t2 = test2.Parameters[0].TypeWithAnnotations;
Symbols\ExtensionMethodTests.cs (6)
2528var arrayType = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(stringType), 1); 2533ImmutableArray.Create<TypeWithAnnotations>(), 2542ImmutableArray.Create(TypeWithAnnotations.Create(intType)), 2551ImmutableArray.Create(TypeWithAnnotations.Create(intType), TypeWithAnnotations.Create(arrayType)), 2563ImmutableArray<TypeWithAnnotations> typeArgs,
Symbols\FunctionPointerTypeSymbolTests.cs (14)
909var ret1 = p1.Signature.ReturnTypeWithAnnotations; 910var ret2 = p2.Signature.ReturnTypeWithAnnotations; 2039TypeWithAnnotations.Create(returnType, customModifiers: customModifiers), 2042parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2048TypeWithAnnotations.Create(returnType), 2051parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2106TypeWithAnnotations.Create(returnType, customModifiers: customModifiers), 2109parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2115TypeWithAnnotations.Create(returnType), 2118parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2165TypeWithAnnotations.Create(returnType, customModifiers: typeCustomModifiers), 2168parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, 2174TypeWithAnnotations.Create(returnType, customModifiers: typeCustomModifiers), 2177parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty,
Symbols\InterfaceImplementationTests.cs (1)
1863var returnType = derived.GetMember<MethodSymbol>(WellKnownMemberNames.DestructorName).ReturnTypeWithAnnotations;
Symbols\Metadata\PE\DynamicTransformsTests.cs (23)
76var arrayOfT = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(t)); 80var arrayOfInnerInnerOfInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(memberInnerInnerOfInt)); 135var arrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(s_dynamicType), 1); 140var arrayOfArrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(arrayOfDynamic), 1); 222var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 233complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 234var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1); 240var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(derivedTypeParam), 1); 246complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 252complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 253complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1); 280var arrayOfDynamic = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(s_dynamicType)); 286var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(derivedTypeParam)); 294var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner)); 300complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner)); 301var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray)); 334var arrayOfDerivedTypeParam = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(unsafeClassTypeParam), 1); 340var pointerToInt = new PointerTypeSymbol(TypeWithAnnotations.Create(_intType)); 341var arrayOfPointerToInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(pointerToInt), 1); 343var arrayOfArrayOfPointerToInt = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(arrayOfPointerToInt), 1); 347var complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 353complicatedInnerInnerArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInner), 1); 354var complicatedInnerInnerArrayOfArray = ArrayTypeSymbol.CreateCSharpArray(_assembly, TypeWithAnnotations.Create(complicatedInnerInnerArray), 1);
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (1)
271var missing = methodSymbol.TypeWithAnnotations;
Symbols\MockNamedTypeSymbol.cs (2)
59internal override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotationsNoUseSiteDiagnostics 63return ImmutableArray.Create<TypeWithAnnotations>();
Symbols\MockSymbolTests.cs (4)
28ArrayTypeSymbol ats1 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 1); 37ArrayTypeSymbol ats2 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 2); 45ArrayTypeSymbol ats3 = ArrayTypeSymbol.CreateCSharpArray(compilation.Assembly, TypeWithAnnotations.Create(elementType), rank: 3); 55PointerTypeSymbol pts1 = new PointerTypeSymbol(TypeWithAnnotations.Create(pointedAtType));
Symbols\Retargeting\RetargetingTests.cs (2)
1153public void CheckSymbols(TypeWithAnnotations a, TypeWithAnnotations b, bool recurse)
Symbols\Source\CompletionTests.cs (3)
44var xType = x.TypeWithAnnotations; 52var yType = y.TypeWithAnnotations; 83var pType = p.TypeWithAnnotations;
Symbols\Source\ModifierTests.cs (3)
158var pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(typeParamType, customModifiers: customModifiers)); // NOTE: We're constructing this manually, since it's illegal. 159var arrayType = ArrayTypeSymbol.CreateCSharpArray(comp.Assembly, TypeWithAnnotations.Create(typeParamType, customModifiers: customModifiers)); // This is legal, but we're already manually constructing types. 161var typeMap = new TypeMap(ImmutableArray.Create(typeParamType), ImmutableArray.Create(TypeWithAnnotations.Create(intType)));
Symbols\Source\TypeMapTests.cs (2)
97return new TypeMap(allTypeParameters.ToImmutableAndFree(), typeArguments.SelectAsArray(t => TypeWithAnnotations.Create(t))).SubstituteNamedType(type); 156var type = v1.TypeWithAnnotations;
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (3)
43var wrappedLocal1 = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.Annotated)); 44var wrappedLocal1a = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.Annotated)); 45var wrappedLocal2 = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local2, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.NotAnnotated));
Symbols\SymbolErrorTests.cs (2)
3374var ptype = param.TypeWithAnnotations; 16956var fieldType = fieldSym.TypeWithAnnotations;
Symbols\TypeTests.cs (1)
473var elemType1 = (field1 as FieldSymbol).TypeWithAnnotations;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\DiagnosticTest.cs (2)
113var type = TypeWithAnnotations.Create(comp.GetSpecialType(SpecialType.System_Object));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (7)
CompilationTestUtils.cs (2)
483var type = TypeWithState.Create( 486return type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat);
SymbolUtilities.cs (2)
105public static string ToTestDisplayString(this TypeWithAnnotations type, bool includeNonNullable = false) 111public static string[] ToTestDisplayStrings(this IEnumerable<TypeWithAnnotations> types)
UsesIsNullableVisitor.cs (3)
131private bool AddIfUsesIsNullable(Symbol symbol, TypeWithAnnotations type, ConsList<TypeParameterSymbol> inProgress) 151private bool UsesIsNullable(TypeWithAnnotations type, ConsList<TypeParameterSymbol> inProgress) 211private bool UsesIsNullable(ImmutableArray<TypeWithAnnotations> types, ConsList<TypeParameterSymbol> inProgress)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdEventTests.cs (1)
3573var eventType = @event.TypeWithAnnotations;
Metadata\WinMdMetadataTests.cs (1)
96var ret = func.ReturnTypeWithAnnotations;