66 references to GetNullableUnderlyingType
Microsoft.CodeAnalysis.CSharp (66)
Binder\Binder_Conversions.cs (7)
327new BoundValuePlaceholder(source.Syntax, source.Type.GetNullableUnderlyingType()), 332destination.GetNullableUnderlyingType(), 344destination.GetNullableUnderlyingType(), 356new BoundValuePlaceholder(source.Syntax, source.Type.GetNullableUnderlyingType()), 815targetType = targetType.GetNullableUnderlyingType(); 2105if (conversionToType.IsNullableType() && TypeSymbol.Equals(conversionToType.GetNullableUnderlyingType(), conversionReturnType, TypeCompareKind.ConsiderEverything2)) 2436destinationWithoutNullable = destination.GetNullableUnderlyingType();
Binder\Binder_Expressions.cs (2)
2547!TypeSymbol.Equals(targetType.GetNullableUnderlyingType(), operand.Type, TypeCompareKind.ConsiderEverything2)) 11099receiverType = receiverType.GetNullableUnderlyingType();
Binder\Binder_Operators.cs (4)
3614if (Conversions.HasIdentityConversion(operandType.GetNullableUnderlyingType(), targetType)) 3668return operandType.Equals(targetType.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) 4013optLeftType.GetNullableUnderlyingType() : 4201var 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)
1453destination.IsNullableType() && destination.GetNullableUnderlyingType().IsEnumType(); 2254TypeSymbol unwrappedDestination = destination.GetNullableUnderlyingType(); 3327return HasBoxingConversion(source.GetNullableUnderlyingType(), destination, ref useSiteInfo); 3863HasUnboxingConversion(source, destination.GetNullableUnderlyingType(), ref useSiteInfo))
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
276EncompassingExplicitConversion(source.GetNullableUnderlyingType(), convertsFrom, ref useSiteInfo).Exists) 285EncompassingExplicitConversion(convertsTo, target.GetNullableUnderlyingType(), ref useSiteInfo).Exists)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
3736type = type.GetNullableUnderlyingType(); 3757type = type.GetNullableUnderlyingType();
BoundTree\BoundNullCoalescingAssignmentOperator.cs (1)
21var nullableUnderlying = leftType.GetNullableUnderlyingType();
FlowAnalysis\NullableWalker.cs (3)
5562TypeSymbol.Equals(targetType.Type.GetNullableUnderlyingType(), node.Type, TypeCompareKind.AllIgnoreOptions)); 6166rvalueType = rvalueType.GetNullableUnderlyingType(); 11822if (isValueType && (!checkNullableValueType || !type.IsNullableTypeOrTypeParameter() || type.GetNullableUnderlyingType().IsErrorType()))
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
608var 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()); 899conversion.Method.GetParameterType(0).Equals(rewrittenOperand.Type.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) && 1063BoundExpression rewrittenConversion = MakeConversionNode(syntax, rewrittenOperand, conversion.UnderlyingConversions[0], rewrittenType.GetNullableUnderlyingType(), @checked); 1183type.GetNullableUnderlyingType(), 1267type.GetNullableUnderlyingType(), 1349if (parameterType.Equals(rewrittenOperand.Type.GetNullableUnderlyingType(), TypeCompareKind.AllIgnoreOptions) && 1383Debug.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)
1509arg.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)
181return type.IsNullableType() ? type.GetNullableUnderlyingType() : type; 1334type = type.GetNullableUnderlyingType(); 2234TypeSymbol underlyingType = type.GetNullableUnderlyingType();