66 references to GetNullableUnderlyingType
Microsoft.CodeAnalysis.CSharp (66)
Binder\Binder_Conversions.cs (7)
331new BoundValuePlaceholder(source.Syntax, source.Type.GetNullableUnderlyingType()), 336destination.GetNullableUnderlyingType(), 348destination.GetNullableUnderlyingType(), 360new BoundValuePlaceholder(source.Syntax, source.Type.GetNullableUnderlyingType()), 576targetType = targetType.GetNullableUnderlyingType(); 1845if (conversionToType.IsNullableType() && TypeSymbol.Equals(conversionToType.GetNullableUnderlyingType(), conversionReturnType, TypeCompareKind.ConsiderEverything2)) 2176destinationWithoutNullable = destination.GetNullableUnderlyingType();
Binder\Binder_Expressions.cs (2)
2506!TypeSymbol.Equals(targetType.GetNullableUnderlyingType(), operand.Type, TypeCompareKind.ConsiderEverything2)) 10905receiverType = receiverType.GetNullableUnderlyingType();
Binder\Binder_Operators.cs (4)
3612if (Conversions.HasIdentityConversion(operandType.GetNullableUnderlyingType(), targetType)) 3666return operandType.Equals(targetType.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) 4011optLeftType.GetNullableUnderlyingType() : 4199var underlyingLeftType = leftType.GetNullableUnderlyingType();
Binder\Binder_Patterns.cs (2)
694convertedExpression = CreateConversion(operand, inputType.GetNullableUnderlyingType(), BindingDiagnosticBag.Discarded); 743Error(diagnostics, ErrorCode.ERR_PatternNullableType, typeSyntax, patternType.GetNullableUnderlyingType());
Binder\ForEachLoopBinder.cs (1)
727collectionExprType.GetNullableUnderlyingType())
Binder\PatternExplainer.cs (1)
357input.Type.IsNullableType() && input.Type.GetNullableUnderlyingType().Equals(evaluationType, TypeCompareKind.AllIgnoreOptions))
Binder\Semantics\Conversions\ConversionsBase.cs (4)
1437destination.IsNullableType() && destination.GetNullableUnderlyingType().IsEnumType(); 2231TypeSymbol unwrappedDestination = destination.GetNullableUnderlyingType(); 3304return HasBoxingConversion(source.GetNullableUnderlyingType(), destination, ref useSiteInfo); 3840HasUnboxingConversion(source, destination.GetNullableUnderlyingType(), ref useSiteInfo))
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
271EncompassingExplicitConversion(source.GetNullableUnderlyingType(), convertsFrom, ref useSiteInfo).Exists) 280EncompassingExplicitConversion(convertsTo, target.GetNullableUnderlyingType(), ref useSiteInfo).Exists)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
3453type = type.GetNullableUnderlyingType(); 3474type = type.GetNullableUnderlyingType();
BoundTree\BoundNullCoalescingAssignmentOperator.cs (1)
21var nullableUnderlying = leftType.GetNullableUnderlyingType();
FlowAnalysis\NullableWalker.cs (3)
5446TypeSymbol.Equals(targetType.Type.GetNullableUnderlyingType(), node.Type, TypeCompareKind.AllIgnoreOptions)); 6050rvalueType = rvalueType.GetNullableUnderlyingType(); 11638if (isValueType && (!checkNullableValueType || !type.IsNullableTypeOrTypeParameter() || type.GetNullableUnderlyingType().IsErrorType()))
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
540var promotedType = e.IsNullableType() ? _nullableType.Construct(PromotedType(e.GetNullableUnderlyingType())) : PromotedType(e);
Lowering\DiagnosticsPass_Warnings.cs (6)
622from = from.GetNullableUnderlyingType(); 627to = to.GetNullableUnderlyingType(); 770Error(ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), node.Left.Type); 774Error(ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), node.Right.Type); 818Error(node.OperatorKind.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Right)); 822Error(node.OperatorKind.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Left));
Lowering\Extensions.cs (1)
132if (expr.Type.IsNullableType() && expr.Type.GetNullableUnderlyingType().SpecialType != SpecialType.System_Boolean)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
219inputType.GetNullableUnderlyingType().Equals(output.Type, TypeCompareKind.AllIgnoreOptions) &&
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
1348type: type.GetNullableUnderlyingType(),
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (1)
135Debug.Assert(TypeSymbol.Equals(accessExpressionType, nodeType.GetNullableUnderlyingType(), TypeCompareKind.ConsiderEverything2));
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (7)
471rewrittenType.GetNullableUnderlyingType()); 802conversion.Method.GetParameterType(0).Equals(rewrittenOperand.Type.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) && 966BoundExpression rewrittenConversion = MakeConversionNode(syntax, rewrittenOperand, conversion.UnderlyingConversions[0], rewrittenType.GetNullableUnderlyingType(), @checked); 1086type.GetNullableUnderlyingType(), 1170type.GetNullableUnderlyingType(), 1252if (parameterType.Equals(rewrittenOperand.Type.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) && 1286Debug.Assert(resultType.IsNullableType() && TypeSymbol.Equals(resultType.GetNullableUnderlyingType(), call.Method.ReturnType, TypeCompareKind.ConsiderEverything2));
Lowering\LocalRewriter\LocalRewriter_Index.cs (2)
24operand = new BoundDefaultExpression(operand.Syntax, operand.Type!.GetNullableUnderlyingType()); 72Debug.Assert(TypeSymbol.Equals(targetNullableType.GetNullableUnderlyingType(), underlyingValue.Type, TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (1)
112Debug.Assert(transformedLHS.Type.GetNullableUnderlyingType().Equals(tmp.Type.StrippedType(), TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
134rewrittenRight.Type.Equals(rewrittenLeft.Type.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions)) 256TypeSymbol strippedLeftType = rewrittenLeftType.GetNullableUnderlyingType();
Lowering\LocalRewriter\LocalRewriter_Range.cs (1)
60operand = new BoundDefaultExpression(operand.Syntax, operand.Type.GetNullableUnderlyingType());
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
444var types = expr.Type.GetNullableUnderlyingType().TupleElementTypesWithAnnotations;
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (4)
365type: type.GetNullableUnderlyingType()); 791else if (unaryOperandType.IsNullableType() && unaryOperandType.GetNullableUnderlyingType().SpecialType == SpecialType.System_Decimal) 833Debug.Assert(operand.Type is { } && operand.Type.IsNullableType() && operand.Type.GetNullableUnderlyingType().SpecialType == SpecialType.System_Decimal); 1022underlyingType = underlyingType.GetNullableUnderlyingType();
Lowering\SyntheticBoundNodeFactory.cs (1)
1565arg.Type.GetNullableUnderlyingType().Equals(type, TypeCompareKind.AllIgnoreOptions))
Symbols\ConstraintsHelper.cs (1)
241var underlyingType = constraintType.Type.GetNullableUnderlyingType();
Symbols\Source\ParameterHelpers.cs (2)
806!(parameterType.GetNullableUnderlyingType().IsEnumType() || parameterType.GetNullableUnderlyingType().IsIntrinsicType()))
Symbols\Source\SourceComplexParameterSymbol.cs (1)
404convertedExpression = binder.GenerateConversionForAssignment(Type.GetNullableUnderlyingType(),
Symbols\TypeSymbolExtensions.cs (3)
172return type.IsNullableType() ? type.GetNullableUnderlyingType() : type; 1310type = type.GetNullableUnderlyingType(); 2184TypeSymbol underlyingType = type.GetNullableUnderlyingType();