Binder\Binder_Constraints.cs (9)
456diagnostics.Add(ErrorCode.ERR_BadVisBound, location, containingSymbol, constraintType.Type);
459if (constraintType.Type.HasFileLocalTypes())
472diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, location, constraintType.Type, containingSymbol);
500Error(diagnostics, ErrorCode.ERR_DuplicateBound, syntax, type.Type.SetUnknownNullabilityForReferenceTypes(), typeParameter.Name);
514Error(diagnostics, ErrorCode.ERR_ClassBoundNotFirst, syntax, type.Type);
529Error(diagnostics, ErrorCode.ERR_RefValBoundWithClass, syntax, type.Type);
538Error(diagnostics, ErrorCode.ERR_RefValBoundWithClass, syntax, type.Type);
544Error(diagnostics, ErrorCode.ERR_UnmanagedBoundWithClass, syntax, type.Type);
562TypeSymbol type = typeWithAnnotations.Type;
Binder\Binder_Conversions.cs (14)
448new BoundValuePlaceholder(source.Syntax, sourceTypes[i].Type),
454destTypes[i].Type,
690var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
691var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
721typeArgument.Type.IsReferenceType &&
723((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type.Equals(typeArgument.Type, TypeCompareKind.ConsiderEverything) &&
725((NamedTypeSymbol)method.ReturnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type.Equals(((NamedTypeSymbol)arg.destination).TypeParameters[0], TypeCompareKind.ConsiderEverything));
1511namedType, forParams, elementTypeOriginalDefinition.Type, builderType, methodName, ref useSiteInfo);
1597var elementType = parameterType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
2364Debug.Assert(elementTypeWithAnnotations.Type is null); // GetCollectionExpressionTypeKind() does not set elementType for these cases.
2385var elementType = elementTypeWithAnnotations.Type;
3200convertedArguments.Add(CreateConversion(argument.Syntax, argument, elementConversion, isCast: isCast, elementConversionGroup, InConversionGroupFlags.Unspecified, destType.Type, diagnostics));
3459bool isAccessible = this.IsSymbolAccessibleConditional(memberSymbol.GetTypeOrReturnType().Type, containingType, ref useSiteInfo);
Binder\Binder_Deconstruct.cs (7)
858var type = declTypeWithAnnotations.Type;
898CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declTypeWithAnnotations.Type, diagnostics, typeSyntax);
902localSymbol.Scope == ScopedKind.ScopedValue && !declTypeWithAnnotations.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
915return new BoundLocal(syntax, localSymbol, BoundLocalDeclarationKind.WithExplicitType, constantValueOpt: null, isNullableUnknown: false, type: declTypeWithAnnotations.Type, hasErrors: hasErrors);
953Debug.Assert(TypeSymbol.Equals(declTypeWithAnnotations.Type, fieldType.Type, TypeCompareKind.ConsiderEverything2));
960type: fieldType.Type);
Binder\Binder_Expressions.cs (37)
489field.GetFieldType(initializerBinder.FieldsBeingBound).Type, diagnostics);
1273return new BoundRefValueOperator(node, typeWithAnnotations.NullableAnnotation, argument, typeWithAnnotations.Type, hasErrors);
1413TypeSymbol type = typeWithAnnotations.Type;
1441var type = typeWithAnnotations.Type;
1466TypeSymbol type = typeWithAnnotations.Type;
1633TypeSymbol type = typeWithAnnotations.Type;
2306type = localSymbol.GetTypeWithAnnotations(node, diagnostics).Type;
2662TypeSymbol targetType = targetTypeWithAnnotations.Type;
2824TypeSymbol targetType = targetTypeWithAnnotations.Type;
2982var targetElementType = targetElementTypesWithAnnotations[i].Type;
3009TypeWithAnnotations underlyingTargetTypeWithAnnotations = targetTypeWithAnnotations.Type.GetNullableUnderlyingTypeWithAnnotations();
3010var underlyingConversion = Conversions.ClassifyBuiltInConversion(operand.Type, underlyingTargetTypeWithAnnotations.Type, isChecked: CheckOverflowAtRuntime, ref discardedUseSiteInfo);
3254var type = declType.Type;
3310CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declType.Type, diagnostics, typeSyntax);
3312if (localSymbol.Scope == ScopedKind.ScopedValue && !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
3317return new BoundLocal(declarationExpression, localSymbol, BoundLocalDeclarationKind.WithExplicitType, constantValueOpt: null, isNullableUnknown: false, type: declType.Type);
3354TypeSymbol fieldType = expressionVariableField.GetFieldType(this.FieldsBeingBound).Type;
3576coercedArgument = bindInterpolatedStringHandlerInMemberCall(argument, parameterTypeWithAnnotations.Type, argumentsForInterpolationConversion, parameters, in methodResult, arg, receiver, diagnostics);
3583coercedArgument = CreateConversion(argument.Syntax, argument, kind, isCast: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, parameterTypeWithAnnotations.Type, diagnostics);
3604coercedArgument = CreateConversion(argument.Syntax, argument, kind, isCast: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, parameterTypeWithAnnotations.Type, diagnostics);
3658Debug.Assert(methodResult.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
3725if (!methodResult.Member.IsIndexer() && !argument.HasAnyErrors && parameterTypeWithAnnotations.Type.ContainsPointerOrFunctionPointer())
4118var type = (ArrayTypeSymbol)BindArrayType(node.Type, diagnostics, permitDimensions: true, basesBeingResolved: null, disallowRestrictedTypes: true).Type;
4601var arrayType = (ArrayTypeSymbol)BindArrayType(arrayTypeSyntax, diagnostics, permitDimensions: true, basesBeingResolved: null, disallowRestrictedTypes: false).Type;
4605if (!elementType.Type.IsErrorType())
4607hasErrors = hasErrors || CheckManagedAddr(Compilation, elementType.Type, elementTypeSyntax.Location, diagnostics, errorForManaged: true);
4658? new BoundStackAllocArrayCreation(node, elementType.Type, count, initializerOpt: null, type, hasErrors: hasErrors)
4659: BindStackAllocWithInitializer(node, node.StackAllocKeyword, node.Initializer, type, elementType.Type, count, diagnostics, hasErrors);
5286var type = typeWithAnnotations.Type;
7720leftType = fieldSymbol.GetFieldType(this.FieldsBeingBound).Type;
7829if (typeArgument.Type.IsPointerOrFunctionPointer() || typeArgument.Type.IsRestrictedType())
7832Error(diagnostics, ErrorCode.ERR_BadTypeArgument, typeArgumentsSyntax[i], typeArgument.Type);
8554resultType = ((FieldSymbol)symbolOpt).GetFieldType(this.FieldsBeingBound).Type;
9223TypeSymbol fieldType = fieldSymbol.GetFieldType(this.FieldsBeingBound).Type;
11510Debug.Assert(returnType.Type is { }); // Expecting System.Void rather than null return type.
11513bool returnsVoid = returnType.Type.IsVoidType();
Binder\Binder_Patterns.cs (6)
1467hasErrors |= CheckValidPatternType(typeSyntax, unionType, inputType, declType.Type, diagnostics: diagnostics);
1502CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declType.Type, diagnostics, typeSyntax ?? (SyntaxNode)designation);
1506syntax: designation, localSymbol: localSymbol, localSymbol.IsVar ? BoundLocalDeclarationKind.WithInferredType : BoundLocalDeclarationKind.WithExplicitType, constantValueOpt: null, isNullableUnknown: false, type: declType.Type);
1587TypeSymbol declType = declTypeWithAnnotations.Type;
1782TypeSymbol elementType = isError ? CreateErrorType() : elementTypesWithAnnotations[i].Type;
2085TypeSymbol elementType = isError ? CreateErrorType() : elementTypes[i].Type;
Binder\Binder_Statements.cs (16)
237TypeSymbol elementType = GetIteratorElementType().Type;
854Error(diagnostics, ErrorCode.ERR_VarDeclIsStaticClass, typeSyntax, declType.Type);
857if (isConst && !declType.Type.CanBeConst())
859Error(diagnostics, ErrorCode.ERR_BadConstType, typeSyntax, declType.Type);
1034Error(localDiagnostics, ErrorCode.ERR_ImplicitlyTypedVariableAssignedBadValue, declarator, declTypeOpt.Type);
1039if (!declTypeOpt.Type.IsErrorType())
1063initializerOpt = BindPossibleArrayInitializer(value, declTypeOpt.Type, valueKind, diagnostics);
1068declTypeOpt.Type,
1090if (!declTypeOpt.Type.IsPointerType())
1094Error(localDiagnostics, declTypeOpt.Type.IsFunctionPointer() ? ErrorCode.ERR_CannotUseFunctionPointerAsFixedLocal : ErrorCode.ERR_BadFixedInitType, declarator);
1098else if (!IsValidFixedVariableInitializer(declTypeOpt.Type, ref initializerOpt, localDiagnostics))
1104CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declTypeOpt.Type, localDiagnostics, typeSyntax);
1106if (localSymbol.Scope == ScopedKind.ScopedValue && !declTypeOpt.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
2105conversionError(diagnostics, ErrorCode.ERR_ExpressionTreeMustHaveDelegate, ((NamedTypeSymbol)targetType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type);
2568var targetElementType = targetElementTypes[i].Type;
3314type = this.BindType(declaration.Type, diagnostics).Type;
Binder\Binder_Symbols.cs (8)
338if (symbol.TypeWithAnnotations.IsResolved) ReportDiagnosticsIfUnsafeMemberAccess(diagnostics, symbol.TypeWithAnnotations.Type, syntax);
542else if (LazyMissingNonNullTypesContextDiagnosticInfo.IsNullableReference(typeArgument.Type))
566ReportUseSite(constructedType.Type.OriginalDefinition, diagnostics, syntax);
567var type = (NamedTypeSymbol)constructedType.Type;
610CheckManagedAddr(Compilation, elementType.Type, node.Location, diagnostics);
625if (type.Type.IsTypeParameterDisallowingAnnotationInCSharp8())
650Error(diagnostics, ErrorCode.ERR_ArrayOfStaticClass, node.ElementType, type.Type);
661Error(diagnostics, ErrorCode.ERR_ArrayElementCantBeRefAny, node.ElementType, type.Type);
Binder\ForEachLoopBinder.cs (13)
200var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, inferredType.Type ?? CreateErrorType("var"));
326CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declType.Type, diagnostics, typeSyntax);
328if (local.Scope == ScopedKind.ScopedValue && !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
385var valuePlaceholder = new BoundDeconstructValuePlaceholder(_syntax.Expression, variableSymbol: null, isDiscardExpression: false, iterationVariableType.Type).MakeCompilerGenerated();
441hasErrors = hasErrors || boundIterationVariableType.HasErrors || iterationVariableType.Type.IsErrorType();
484Conversion elementConversionClassification = this.Conversions.ClassifyConversionFromType(inferredType.Type, iterationVariableType.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo, forCast: true);
488Error(diagnostics, ErrorCode.ERR_RefAssignmentMustHaveIdentityConversion, collectionExpr.Syntax, iterationVariableType.Type);
492var elementPlaceholder = new BoundValuePlaceholder(_syntax, inferredType.Type).MakeCompilerGenerated();
500diagnostics.Add(ErrorCode.ERR_AmbigUDConv, foreachKeyword.GetLocation(), originalUserDefinedConversions[0], originalUserDefinedConversions[1], inferredType.Type, iterationVariableType);
504SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, inferredType.Type, iterationVariableType.Type);
516BoundExpression elementConversion = CreateConversion(_syntax, elementPlaceholder, elementConversionClassification, isCast: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, iterationVariableType.Type, createConversionDiagnostics);
Binder\Semantics\AccessCheck.cs (3)
164return IsSymbolAccessibleCore(((DiscardSymbol)symbol).TypeWithAnnotations.Type, within, null, out failedThroughTypeCheck, compilation, ref useSiteInfo, basesBeingResolved);
239if (typeArg.Type.Kind != SymbolKind.TypeParameter && !IsSymbolAccessibleCore(typeArg.Type, within, null, out unused, compilation, ref useSiteInfo, basesBeingResolved))
Binder\Semantics\Conversions\ConversionsBase.cs (41)
1503!invokeMethod.ReturnType.Equals(returnType.Type, TypeCompareKind.AllIgnoreOptions))
1618var delegateType = type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
1895var type = typeWithAnnotations.Type;
1908Conversion conversion = ClassifyImplicitConversionFromType(source.Type, destination.Type, ref discardedUseSiteInfo);
1976conversions.ClassifyImplicitExtensionMethodThisArgConversion(s, s.Type, d.Type, ref u, isMethodGroupConversion: false),
1998return conversions.ClassifyImplicitExtensionMethodThisArgConversion(sourceExpressionOpt: null, s.Type, d.Type, ref u, isMethodGroupConversion: false);
2311=> conversions.ClassifyImplicitConversionFromExpression(s, d.Type, ref u),
2329conversions.ClassifyConversionFromExpression(s, d.Type, isChecked: isChecked, ref u, forCast: forCast),
2383Conversion conversion = conversions.ClassifyImplicitConversionFromType(s.Type, d.Type, ref u);
2405Conversion conversion = conversions.ClassifyConversionFromType(s.Type, d.Type, isChecked: isChecked, ref u, forCast);
2620return HasIdentityOrImplicitReferenceConversion(elementType.Type, argument0.Type, ref useSiteInfo);
2634HasIdentityConversionInternal(source.Type, destination.Type, includeNullability: true))
2639return HasImplicitReferenceConversion(source.Type, destination.Type, ref useSiteInfo);
3202if (HasIdentityConversionInternal(sourceTypeArgument.Type, destinationTypeArgument.Type) &&
3208TypeParameterSymbol typeParameterSymbol = (TypeParameterSymbol)typeParameters[paramIndex].Type;
3221TypeSymbol.Equals(destinationTypeArgument.Type, sourceTypeArgument.Type, TypeCompareKind.AllNullableIgnoreOptions) &&
3441&& (HasIdentityOrImplicitReferenceConversion(sourceType.Type, destinationType.Type, ref useSiteInfo)
3442|| HasImplicitPointerToVoidConversion(sourceType.Type, destinationType.Type)
3443|| HasImplicitPointerConversion(sourceType.Type, destinationType.Type, ref useSiteInfo));
3447&& HasIdentityConversion(sourceType.Type, destinationType.Type);
3708var sourceArg = sourceTypeArguments[i].Type;
3709var destinationArg = destinationTypeArguments[i].Type;
3791if (HasExplicitReferenceConversion(sourceArray.ElementType, ((NamedTypeSymbol)destination).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo).Type, ref useSiteInfo))
3811var sourceElement = ((NamedTypeSymbol)source).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo).Type;
4028return HasIdentityConversionInternal(source.Type, destination.Type) &&
4050return HasIdentityOrReferenceConversion(elementType.Type, spanElementType.Type, ref useSiteInfo) &&
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (77)
470if (!fixedResultType.Type.IsErrorType())
479var errorTypeName = fixedResultType.Type.Name;
508TypeParameterSymbol typeParameter = (TypeParameterSymbol)type.Type;
541var methodTypeParameter = (TypeParameterSymbol)methodTypeParameterWithAnnotations.Type;
575return typeMap.SubstituteType(delegateOrFunctionPointerType).Type;
615ExactOrBoundsKind kind = GetRefKind(arg).IsManagedReference() || target.Type.IsPointerType() ? ExactOrBoundsKind.Exact : ExactOrBoundsKind.LowerBound;
637if (argument.Kind == BoundKind.UnboundLambda && target.Type.GetDelegateType() is { })
651if (IsReallyAType(argumentType.Type))
657var ordinal = GetOrdinal((TypeParameterSymbol)target.Type);
670TypeSymbol targetType = target.Type;
705Debug.Assert(target.Type is { });
706if (target.Type is null)
727if (target.Type.Kind != SymbolKind.NamedType)
733var destination = (NamedTypeSymbol)target.Type;
889if (HasUnfixedParamInOutputType(argument, formalType.Type) && !HasUnfixedParamInInputType(argument, formalType.Type))
907if (!binder.TryGetCollectionIterationType((ExpressionSyntax)argument.Syntax, formalType.Type, out TypeWithAnnotations targetElementType))
923if (formalType.Type.Kind != SymbolKind.NamedType)
929var destination = (NamedTypeSymbol)formalType.Type;
1146var formalParameterType = _formalParameterTypes[iArg].Type;
1388if (MethodGroupReturnTypeInference(binder, expression, target.Type, ref useSiteInfo))
1410var delegateType = target.Type.GetDelegateType();
1432Debug.Assert(inferredReturnType.Type is not FunctionTypeSymbol);
1571var delegateType = target.Type.GetDelegateType();
1624var delegateInvokeMethod = target.Type.GetDelegateType()?.DelegateInvokeMethod();
1669if (ExactSpanInference(source.Type, target.Type, ref useSiteInfo))
1714if (!source.Type.IsArray() || !target.Type.IsArray())
1719var arraySource = (ArrayTypeSymbol)source.Type;
1720var arrayTarget = (ArrayTypeSymbol)target.Type;
1809ExactOrBoundsInference(kind, ((NamedTypeSymbol)source.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], ((NamedTypeSymbol)target.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], ref useSiteInfo);
1843if (!source.Type.TryGetElementTypesWithAnnotationsIfTupleType(out sourceTypes) ||
1844!target.Type.TryGetElementTypesWithAnnotationsIfTupleType(out targetTypes) ||
1867var namedSource = source.Type as NamedTypeSymbol;
1873var namedTarget = target.Type as NamedTypeSymbol;
1892ExactInference(((PointerTypeSymbol)source.Type).PointedAtTypeWithAnnotations, ((PointerTypeSymbol)target.Type).PointedAtTypeWithAnnotations, ref useSiteInfo);
1895else if (source.Type is FunctionPointerTypeSymbol { Signature: { ParameterCount: int sourceParameterCount } sourceSignature } &&
1896target.Type is FunctionPointerTypeSymbol { Signature: { ParameterCount: int targetParameterCount } targetSignature } &&
2006if (LowerBoundArrayInference(source.Type, target.Type, ref useSiteInfo))
2013if (LowerBoundSpanInference(source.Type, target.Type, ref useSiteInfo))
2050if (LowerBoundConstructedInference(source.Type, target.Type, ref useSiteInfo))
2055if (LowerBoundFunctionPointerTypeInference(source.Type, target.Type, ref useSiteInfo))
2139if (elementSource.Type.IsReferenceType)
2174if (!sourceElementType.Type.IsReferenceType || target.IsSpan())
2407if (sourceTypeArgument.Type.IsReferenceType && typeParameter.Variance == VarianceKind.Out)
2411else if (sourceTypeArgument.Type.IsReferenceType && typeParameter.Variance == VarianceKind.In)
2514Debug.Assert(source.Type.IsReferenceType || source.Type.IsFunctionPointer());
2531if (UpperBoundFunctionPointerTypeInference(source.Type, target.Type, ref useSiteInfo))
2566if (!target.Type.IsArray())
2570var arrayTarget = (ArrayTypeSymbol)target.Type;
2572var elementSource = GetMatchingElementType(arrayTarget, source.Type, ref useSiteInfo);
2578if (elementSource.Type.IsReferenceType)
2599var source = sourceWithAnnotations.Type;
2600var target = targetWithAnnotations.Type;
2757if (sourceTypeArgument.Type.IsReferenceType && typeParameter.Variance == VarianceKind.Out)
2761else if (sourceTypeArgument.Type.IsReferenceType && typeParameter.Variance == VarianceKind.In)
2851Debug.Assert(best.Type.Type.Equals(withoutNullability.Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
3016functionType = type.Type as FunctionTypeSymbol;
3023return constraintTypes.Any(static t => isExpressionType(t.Type));
3042var source = sourceWithAnnotations.Type;
3043var destination = destinationWithAnnotations.Type;
3319if (!dest.Type.ContainsTypeParameter(pParam))
3463var newBound = TypeWithAnnotations.Create(oldBound.Type, newAnnotation);
3489if (newCandidate.Type.IsDynamic())
3520return obj.Type.GetHashCode();
3527if (x.Type.IsDynamic() ^ y.Type.IsDynamic()) { return false; }
Binder\Semantics\OverloadResolution\OverloadResolution.cs (20)
1266expandedResult.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel)
1355if (elementType.Type is null)
1377Debug.Assert(elementType.Type is { });
2589Debug.Assert(paramsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
2590return paramsElementTypeOpt.Type;
3244t1, kind1, elementType1.Type, underlyingElementConversions1: [],
3245t2, kind2, elementType2.Type, underlyingElementConversions2: [],
3259elementType = typeArg.Type;
3302if (x.HasType && Conversions.HasIdentityConversion(x.Type, y))
3312y = ((NamedTypeSymbol)y).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
3405if (!ExpressionMatchExactly(sourceArguments[i], destTypes[i].Type, ref useSiteInfo))
3552return BetterConversionTargetCore(((NamedTypeSymbol)type1).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type,
3553((NamedTypeSymbol)type2).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type,
3663var type1Element = ((NamedTypeSymbol)type1).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
3664var type2Element = ((NamedTypeSymbol)type2).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
4083TryInferParamsCollectionIterationType(binder, type.Type, out paramsIterationType);
4356if (!parameterTypes[i].Type.CheckAllConstraints(Compilation, Conversions))
4604&& parameters.ParameterTypes[argumentPosition].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true })
4617parameters.ParameterTypes[argumentPosition].Type,
4629(ignoreOpenTypes && TypeContainsTypeParameterFromContainer(candidate, parameters.ParameterTypes[argumentPosition].Type))));
BoundTree\VariablePendingInference.cs (4)
65Binder.CheckRestrictedTypeInAsyncMethod(localSymbol.ContainingSymbol, type.Type, diagnosticsOpt, typeOrDesignationSyntax);
67if (localSymbol.Scope == ScopedKind.ScopedValue && !type.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
76return new BoundLocal(this.Syntax, localSymbol, BoundLocalDeclarationKind.WithInferredType, constantValueOpt: null, isNullableUnknown: false, type: type.Type, hasErrors: this.HasErrors || inferenceFailed).WithWasConverted();
106type: type.Type,
FlowAnalysis\NullableWalker.cs (93)
149Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything));
806if (symbolType.Type.IsValueType || symbolType.Type.IsErrorType())
839var badState = symbolType.Type.IsPossiblyNullableReferenceTypeTypeParameter() && (annotations & FlowAnalysisAnnotations.NotNull) == 0
897SetState(ref this.State, memberSlot, type.Type.IsPossiblyNullableReferenceTypeTypeParameter() ? NullableFlowState.MaybeDefault : NullableFlowState.MaybeNull);
2069_variables[containingSlot].Symbol.GetTypeOrReturnType().Type is NamedTypeSymbol { IsUnionType: true, UnionCaseTypes: not [] } unionType &&
2424type.Type.IsValueType)
2441if (type.Type.IsTypeParameterDisallowingAnnotationInCSharp8() && !(type.Type is TypeParameterSymbol { IsNotNullable: true }))
2467!targetType.Type.Equals(valueType.Type, TypeCompareKind.AllIgnoreOptions))
2700InheritDefaultState(targetType.Type, targetSlot);
2706if (targetType.Type.IsReferenceType ||
2715else if (EmptyStructTypeCache.IsTrackableStructType(targetType.Type))
2717InheritNullableStateOfTrackableStruct(targetType.Type, targetSlot, valueSlot, isDefaultValue: !(valueOpt is null) && IsDefaultValue(valueOpt), skipSlot: targetSlot);
2723target.Type.Equals(assignedValue.Type, TypeCompareKind.AllIgnoreOptions);
2795if (fieldOrPropertyType.Type.IsReferenceType ||
2824else if (EmptyStructTypeCache.IsTrackableStructType(fieldOrPropertyType.Type))
2834InheritNullableStateOfTrackableStruct(fieldOrPropertyType.Type, targetMemberSlot, valueMemberSlot, isDefaultValue: isDefaultValue, skipSlot);
2917private static TypeSymbol GetTypeOrReturnType(Symbol symbol) => symbol.GetTypeOrReturnType().Type;
2949typeWithAnnotations = TypeWithAnnotations.Create(typeWithAnnotations.Type, nullableAnnotation);
3050if (EmptyStructTypeCache.IsTrackableStructType(parameterType.Type))
3053parameterType.Type,
3086return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault);
3091return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull);
3115returnType.Type.SpecialType == SpecialType.System_Boolean)
3223type = ((NamedTypeSymbol)returnType.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single();
3249if (!node.Type.Equals(type.Type, TypeCompareKind.ConsiderEverything | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes | TypeCompareKind.IgnoreDynamicAndTupleNames))
3254Debug.Assert(node.Type.IsErrorType() || type.Type.IsErrorType());
3617VisitObjectCreationInitializer(resultSlot, resultType.Type, withExpr.InitializerExpression, delayCompletionForType: false);
3695InheritDefaultState(GetDeclaredLocalResult(local).Type, slot);
3753Debug.Assert(type.Type.IsErrorType());
3832return AnonymousTypeManager.GetAnonymousTypeFieldTypes(type).Any(static t => canIgnoreAnyType(t.Type));
4184var strippedTargetCollectionType = targetCollectionType.Type.StrippedType();
4358Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4360var type = resultTypeWithAnnotations.Type;
4437if (AreNullableAndUnderlyingTypes(type, parameterType.Type, out TypeWithAnnotations underlyingType))
4871Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4929Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
5181inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation);
5777if (isLifted && targetTypeWithNullability.Type.IsNonNullableValueType())
6162Debug.Assert(targetType.Type.ContainsErrorType() ||
6164TypeSymbol.Equals(targetType.Type.GetNullableUnderlyingType(), node.Type, TypeCompareKind.AllIgnoreOptions));
6168leftSlot = GetNullableOfTValueSlot(targetType.Type, leftSlot, out _);
6174Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions));
6178TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State);
6441TypeSymbol accessType = accessTypeWithAnnotations.Type;
6635var typeWithState = TypeWithState.Create(resultTypeWithAnnotations.Type, resultState);
6648return TypeWithState.Create(resultTypeWithAnnotations.Type, resultState);
6763new BoundExpressionWithNullability(expr.Syntax, expr, type.NullableAnnotation, type.Type);
8217conversion = GenerateConversion(_conversions, argumentNoConversion, argumentResultType, parameterType.Type, fromExplicitCast: false, extensionMethodThisArgument: false, isChecked: conversionOpt?.Checked ?? false);
8221ReportNullabilityMismatchInArgument(argumentNoConversion.Syntax, argumentResultType, parameter, parameterType.Type, forOutput: false);
8253if (IsNullabilityMismatch(lvalueResultType.Type, parameterType.Type))
8256ReportNullabilityMismatchInRefArgument(argumentNoConversion, argumentType: lvalueResultType.Type, parameter, parameterType.Type);
8361parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState);
8418if (!_conversions.HasIdentityOrImplicitReferenceConversion(parameterType.Type, lValueType.Type, ref discardedUseSiteInfo))
8420ReportNullabilityMismatchInArgument(argument.Syntax, lValueType.Type, parameter, parameterType.Type, forOutput: true);
8674OverloadResolution.TryInferParamsCollectionIterationType(_binder, type.Type, out paramsIterationType);
8925return new BoundExpressionWithNullability(argument.Syntax, argument, argumentType.NullableAnnotation, argumentType.Type);
9240if (TypeAllowsConditionalState(targetType.Type) && TypeAllowsConditionalState(operand.Type))
9353if (typeArg.Type.Equals(underlyingTypeOpt, TypeCompareKind.AllIgnoreOptions))
9590Debug.Assert(targetField.TypeWithAnnotations.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true });
9834operandType = completion(targetTypeWithNullability.Type.GetNullableUnderlyingTypeWithAnnotations());
9862TypeSymbol targetType = targetTypeWithNullability.Type;
10236if (targetType.Type?.IsTypeParameterDisallowingAnnotationInCSharp8() == true)
10245dependsOnTypeParameter(typeParameter1, (TypeParameterSymbol)targetType.Type, NullableAnnotation.NotAnnotated, out var annotation))
10252if (targetType.Type?.IsTypeParameterDisallowingAnnotationInCSharp8() == false)
10276targetType.Type is TypeParameterSymbol typeParameter2)
10326if (constraintType.Type is TypeParameterSymbol constraintTypeParameter &&
10437TypeSymbol targetType = targetTypeWithNullability.Type;
10594var resultType = TypeWithState.Create(targetTypeWithNullability.Type, NullableFlowState.NotNull);
10605Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
10606Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
10624TypeSymbol targetType = targetTypeWithNullability.Type;
10641Debug.Assert(TypeSymbol.Equals(analysis.FromType, parameterType.Type, TypeCompareKind.AllIgnoreOptions));
10695targetTypeWithNullability.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true } unionType &&
10777bool typeNeedsLifting = returnType.Type.IsNonNullableValueType();
10778TypeSymbol type = typeNeedsLifting ? MakeNullableOf(returnType) : returnType.Type;
10822var conversion = _conversions.ClassifyStandardConversion(operandType.Type, targetType.Type, ref discardedUseSiteInfo);
10827ReportNullabilityMismatchInArgument(diagnosticLocation, operandType.Type, parameterOpt, targetType.Type, forOutput: false);
10831ReportNullabilityMismatchInAssignment(diagnosticLocation, operandType.Type, targetType.Type);
10912Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
10913var delegateType = (NamedTypeSymbol)resultTypeWithAnnotations.Type;
11092arguments.Add(new BoundExpressionWithNullability(syntax, new BoundParameter(syntax, parameter), parameterType.NullableAnnotation, parameterType.Type));
11265SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType);
11603AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType))
11608var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull);
11609TrackNullableStateOfNullableValue(targetSlot, lvalueType.Type, rightPart, valueBeforeNullableWrapping, valueSlot);
12627conversion = _conversions.ClassifyImplicitConversionFromType(sourceType.Type, destinationType.Type, ref discardedUseSiteInfo);
FlowAnalysis\NullableWalker_Patterns.cs (8)
637inferredType = TypeWithAnnotations.Create(inferredType.Type, existingType.NullableAnnotation.Join(inferredType.NullableAnnotation));
703addToTempMap(output, outputSlot, parameterType.Type);
771addToTempMap(output, outputSlot, type.Type);
786addToTempMap(output, outputSlot, type.Type);
794addToTempMap(output, outputSlot, type.Type);
805addToTempMap(output, outputSlot, type.Type);
816addToTempMap(output, outputSlot, type.Type);
1122TypeWithState resultType = TypeWithState.Create(inferredTypeWithAnnotations.Type, inferredState);
Symbols\ConstraintsHelper.cs (52)
161Debug.Assert(!constraintType.Type.ContainsDynamic());
170var constraintTypeParameter = (TypeParameterSymbol)constraintType.Type;
225if (constraintType.Type.IsInterfaceType())
227AddInterface(interfacesBuilder, (NamedTypeSymbol)constraintType.Type);
233constraintEffectiveBase = (NamedTypeSymbol)constraintType.Type;
234constraintDeducedBase = constraintType.Type;
241var underlyingType = constraintType.Type.GetNullableUnderlyingType();
259constraintDeducedBase = constraintType.Type;
265constraintDeducedBase = constraintType.Type;
271constraintDeducedBase = constraintType.Type;
275constraintEffectiveBase = (NamedTypeSymbol)constraintType.Type;
276constraintDeducedBase = constraintType.Type;
956if (typeArgument.Type.IsPointerOrFunctionPointer() || typeArgument.IsRestrictedType(ignoreSpanLikeTypes: true) || typeArgument.IsVoidType())
959diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_BadTypeArgument, typeArgument.Type))));
963if (typeArgument.Type.IsRefLikeOrAllowsRefLikeType())
984diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_NotRefStructConstraintNotSatisfied, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
992diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_GenericArgIsStaticClass, typeArgument.Type))));
998if (!typeArgument.Type.IsReferenceType)
1001diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_RefConstraintNotSatisfied, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
1011var managedKind = typeArgument.Type.GetManagedKind(ref useSiteInfo);
1014if (managedKind == ManagedKind.Managed || !typeArgument.Type.IsNonNullableValueType())
1017diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_UnmanagedConstraintNotSatisfied, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
1040if (typeParameter.HasValueTypeConstraint && !typeArgument.Type.IsNonNullableValueType())
1043diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_ValConstraintNotSatisfied, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
1069if (typeArgument.Type.IsErrorType())
1091if (typeArgument.Type is NamedTypeSymbol { IsInterface: true } iface && SelfOrBaseHasStaticAbstractMember(iface, ref useSiteInfo, out Symbol member))
1120var error = SatisfiesConstructorConstraint(typeArgument.Type);
1128diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_NewConstraintNotSatisfied, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
1132diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.ERR_NewConstraintCannotHaveRequiredMembers, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
1149if (typeParameter.HasNotNullConstraint && typeArgument.GetValueNullableAnnotation().IsAnnotated() && !typeArgument.Type.IsNonNullableValueType())
1189if (typeArgument.Type.IsReferenceType)
1195errorCode = constraintType.Type.IsInterfaceType() ? ErrorCode.ERR_GenericConstraintNotSatisfiedNullableInterface : ErrorCode.ERR_GenericConstraintNotSatisfiedNullableEnum;
1209if (constraintType.Type.Equals(typeArgument.Type, TypeCompareKind.AllIgnoreOptions))
1211constraintTypeErrorArgument = constraintType.Type;
1212typeArgumentErrorArgument = typeArgument.Type;
1217SymbolDistinguisher distinguisher = new SymbolDistinguisher(args.CurrentCompilation, constraintType.Type, typeArgument.Type);
1228var type = typeWithAnnotations.Type;
1271var type = typeWithAnnotations.Type;
1350if (constraintType.Type.IsErrorType())
1361if (conversions.HasIdentityOrImplicitReferenceConversion(typeArgument.Type, constraintType.Type, ref useSiteInfo))
1366if (typeArgument.Type.IsValueType)
1370if (conversions.HasBoxingConversion(typeArgument.Type.IsNullableType() ? ((NamedTypeSymbol)typeArgument.Type).ConstructedFrom : typeArgument.Type,
1371constraintType.Type, ref useSiteInfo))
1376if (typeArgument.Type is NamedTypeSymbol { IsRefLikeType: true } refLike &&
1377conversions.ImplementsVarianceCompatibleInterface(refLike, constraintType.Type, ref useSiteInfo))
1385var typeParameter = (TypeParameterSymbol)typeArgument.Type;
1389if (conversions.HasImplicitTypeParameterConversion(typeParameter, constraintType.Type, ref useSiteInfo))
Symbols\Source\SourceComplexParameterSymbol.cs (11)
1094else if (!compilation.Conversions.HasCallerLineNumberConversion(TypeWithAnnotations.Type, ref useSiteInfo))
1098diagnostics.Add(ErrorCode.ERR_NoConversionForCallerLineNumberParam, node.Name.Location, intType, TypeWithAnnotations.Type);
1122else if (!compilation.Conversions.HasCallerInfoStringConversion(TypeWithAnnotations.Type, ref useSiteInfo))
1126diagnostics.Add(ErrorCode.ERR_NoConversionForCallerFilePathParam, node.Name.Location, stringType, TypeWithAnnotations.Type);
1155else if (!compilation.Conversions.HasCallerInfoStringConversion(TypeWithAnnotations.Type, ref useSiteInfo))
1159diagnostics.Add(ErrorCode.ERR_NoConversionForCallerMemberNameParam, node.Name.Location, stringType, TypeWithAnnotations.Type);
1196else if (!compilation.Conversions.HasCallerInfoStringConversion(TypeWithAnnotations.Type, ref useSiteInfo))
1200diagnostics.Add(ErrorCode.ERR_NoConversionForCallerArgumentExpressionParam, node.Name.Location, stringType, TypeWithAnnotations.Type);
1615var elementType = elementTypeWithAnnotations.Type;
1628elementType = elementTypeWithAnnotations.Type;
1687elementType = elementTypeWithAnnotations.Type;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (16)
811if (IsOrContainsErrorType(parameterType.Type))
980if (!IsOrContainsErrorType(overridingMemberType.Type))
982diagnostics.Add(ErrorCode.ERR_CantChangeTypeOnOverride, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type);
1026if (DeclaringCompilation.Conversions.HasIdentityOrImplicitReferenceConversion(overridingMethod.ReturnTypeWithAnnotations.Type, overriddenMethod.ReturnTypeWithAnnotations.Type, ref discardedUseSiteInfo))
1091if (!IsOrContainsErrorType(overridingMemberType.Type))
1096DeclaringCompilation.Conversions.HasIdentityOrImplicitReferenceConversion(overridingMemberType.Type, overriddenMemberType.Type, ref discardedUseSiteInfo))
1100diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportCovariantPropertiesOfClasses, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type);
1112diagnostics.Add(ErrorCode.ERR_CantChangeTypeOnOverride, overridingMemberLocation, overridingMember, overriddenMember, overriddenMemberType.Type);
1240var result = DeclaringCompilation.Conversions.HasIdentityOrImplicitReferenceConversion(overridingReturnType.Type, overriddenReturnType.Type, ref useSiteInfo);
1305overrideReturnType.Type,
1306baseMethod.ReturnTypeWithAnnotations.Type))
1338baseParameterType.Type,
1339overrideParameterType.Type))
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (10)
70AppendClrType(extendedType.Type, extendedType.CustomModifiers, builder);
122AppendClrType(typeConstraint.Type, typeConstraint.CustomModifiers, constraintBuilder.Builder);
174AppendClrType(pointedAtType.Type, pointedAtType.CustomModifiers, builder);
255AppendClrType(typeArgument.Type, typeArgument.CustomModifiers, builder);
284AppendClrType(elementType.Type, elementType.CustomModifiers, builder);
315AppendClrType(returnType.Type, returnType.CustomModifiers, builder);
333AppendClrType(parameterType.Type, parameterType.CustomModifiers, builder);
435appendType(type.Type, builder);
438if (!type.Type.IsValueType)
1003AppendClrType(parameterType.Type, parameterType.CustomModifiers, builder);
Symbols\TypeUnification.cs (25)
36return (NamedTypeSymbol)SubstituteAllTypeParameters(substitution, TypeWithAnnotations.Create(candidateSubtype)).Type;
54Debug.Assert(substituted1.Type.Equals(substituted2.Type, TypeCompareKind.CLRSignatureCompareOptions));
111if (TypeSymbol.Equals(t1.Type, t2.Type, TypeCompareKind.CLRSignatureCompareOptions) && t1.CustomModifiers.SequenceEqual(t2.CustomModifiers))
118if (!t1.Type.IsTypeParameter() && t2.Type.IsTypeParameter())
126Debug.Assert(t1.Type.IsTypeParameter() || !t2.Type.IsTypeParameter());
128switch (t1.Type.Kind)
137ArrayTypeSymbol at1 = (ArrayTypeSymbol)t1.Type;
138ArrayTypeSymbol at2 = (ArrayTypeSymbol)t2.Type;
154PointerTypeSymbol pt1 = (PointerTypeSymbol)t1.Type;
155PointerTypeSymbol pt2 = (PointerTypeSymbol)t2.Type;
167NamedTypeSymbol nt1 = (NamedTypeSymbol)t1.Type;
168NamedTypeSymbol nt2 = (NamedTypeSymbol)t2.Type;
204if (t2.Type.IsPointerOrFunctionPointer() || t2.IsVoidType())
209TypeParameterSymbol tp1 = (TypeParameterSymbol)t1.Type;
213if (Contains(t2.Type, tp1))
226AddSubstitution(ref substitution, tp1, TypeWithAnnotations.Create(t2.Type));
234TypeWithAnnotations.Create(t2.Type,
239if (t2.Type.IsTypeParameter())
241var tp2 = (TypeParameterSymbol)t2.Type;
253TypeWithAnnotations.Create(t1.Type,
301if (Contains(typePart.Type, typeParam))
Symbols\TypeWithAnnotations.cs (49)
63public override string ToString() => Type.ToString();
110if (NullableAnnotation.IsAnnotated() || (Type.IsValueType && Type.IsNullableType()))
115return Create(Type, NullableAnnotation.Annotated, CustomModifiers);
120if (NullableAnnotation.IsNotAnnotated() || (Type.IsValueType && !Type.IsNullableType()))
125return Create(Type, NullableAnnotation.NotAnnotated, CustomModifiers);
136if (Type?.IsPossiblyNullableReferenceTypeTypeParameter() == true)
141if (Type.IsNullableTypeOrTypeParameter())
160return Type.IsNullableTypeOrTypeParameter();
198var typeSymbol = this.Type;
243TypeSymbol typeSymbol = other.Type;
245TypeSymbol type = Type.MergeEquivalentTypes(typeSymbol, variance);
264public bool IsNullableType() => Type.IsNullableType();
267/// The list of custom modifiers, if any, associated with the <see cref="Type"/>.
271public TypeKind TypeKind => Type.TypeKind;
273public Cci.PrimitiveTypeCode PrimitiveTypeCode => Type.PrimitiveTypeCode;
304var str = !HasType ? "<null>" : Type.ToDisplayString(format);
309(!HasType || (!IsNullableType() && !Type.IsValueType)))
315(!HasType || (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8())))
377TypeSymbol type = Type;
408return obj.Type.GetHashCode();
426return Type.GetUnificationUseSiteDiagnosticRecursive(ref result, owner, ref checkedTypes) ||
445TypeSymbol typeSymbol = this.Type;
454if (typeSymbol.Equals(newTypeWithModifiers.Type, TypeCompareKind.ConsiderEverything) &&
465return Create(newTypeWithModifiers.Type, NullableAnnotation, newCustomModifiers);
478if (newTypeWithModifiers.Type is PlaceholderTypeArgumentSymbol)
484Debug.Assert(newTypeWithModifiers.Type is not IndexedTypeParameterSymbol || newTypeWithModifiers.NullableAnnotation == NullableAnnotation.Ignored);
512Debug.Assert((object)newTypeWithModifiers.DefaultType == newTypeWithModifiers.Type);
534newTypeWithModifiers.Type,
544return Type.Equals(other.Type, comparison);
549binder.ReportDiagnosticsIfObsolete(diagnostics, Type, syntax, hasBaseReceiver: false);
596typeWithAnnotationsPredicate: (t, a, b) => t.NullableAnnotation != NullableAnnotation.Oblivious && !t.Type.IsErrorType() && !t.Type.IsValueType,
629var type = typeWithAnnotations.Type;
665TypeSymbol oldTypeSymbol = Type;
726var typeSymbol = Type;
737var typeSymbol = Type;
775return Type.GetHashCode();
811return TypeWithState.Create(Type, getFlowState(Type, NullableAnnotation));
1084TryForceResolve(asValueType: _underlying.Type.IsValueType);
1090internal override TypeSymbol GetNullableUnderlyingTypeOrSelf(TypeSymbol typeSymbol) => _underlying.Type;
1145if (!_underlying.Type.IsValueType)
1162if (newUnderlying.Type.Equals(this._underlying.Type, TypeCompareKind.ConsiderEverything) &&
1204_underlying.Type;