1 instantiation of NullableType
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
162pNullableType = new NullableType(pUnderlyingType);
88 references to NullableType
Microsoft.CSharp (88)
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (1)
538ErrAppendType(((NullableType)pType).UnderlyingType, null);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
545else if (callingObjectType is NullableType callingNub)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (7)
323if (!(type1 is NullableType nub1) || !(type2 is NullableType nub2) || 330PredefinedType pt1 = (type1 as NullableType).UnderlyingType.PredefinedType; 331PredefinedType pt2 = (type2 as NullableType).UnderlyingType.PredefinedType; 1017if (ctypeLiftBest > 0 && !(typeFrom is NullableType) && fDstHasNull) 1044NullableType pConversionNubSourceType = TypeManager.GetNullable(typeFrom); 1050if (typeTo is NullableType)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (1)
330public static bool FWrappingConv(CType typeSrc, CType typeDst) => typeDst is NullableType nubDst && typeSrc == nubDst.UnderlyingType;
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (3)
111if (_typeDest is NullableType) 117if (_typeSrc is NullableType) 200if (valueSrc.Type is NullableType)
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (5)
614NullableType nubParam; 668if (!(arg.Type is NullableType) || !canConvert(arg.Type.StripNubs(), typeRaw, CONVERTTYPE.NOUDC)) 673Debug.Assert(arg.Type is NullableType); 676if (!(typeRet is NullableType)) 1015if (typeObj is NullableType nubTypeObj && (typeTmp = nubTypeObj.GetAts()) != swt.GetType())
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (1)
523else if ((pParamType.IsReferenceType || pParamType is NullableType) && cv.IsNullRef)
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (4)
128if (_typeDest is NullableType nubDest) 133if (_typeSrc is NullableType nubSrc) 266private bool BindNubConversion(NullableType nubDst) 423private bool bindImplicitConversionFromNullable(NullableType nubSrc)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (2)
839if (!(pSource is NullableType nubSource) || !(pDest is NullableType nubDest))
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (4)
42Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 52NullableType nubSrc = (NullableType)exprSrc.Type; 69NullableType pNubSourceType = TypeManager.GetNullable(exprSrc.Type);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (32)
473if (info.type1 is NullableType && info.type2 is NullType) 478if (info.type1 is NullType && info.type2 is NullableType) 621Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 655if (!(resultType is NullableType)) 684if (pParameterType is NullableType paramNub) 756Debug.Assert(!(typeDst is NullableType)); 770if (info.type2 is NullableType) 790Debug.Assert(!(typeDst is NullableType)); 806if (info.type1 is NullableType) 832Debug.Assert(info.type1 is NullableType); 843Debug.Assert(info.type2 is NullableType); 1185if (type is NullableType nub) 1502if (typeSig is NullableType) 1543NullableType type = uofs.GetType() as NullableType; 1748Debug.Assert(!(type is NullableType)); 1772NullableType type = uofs.GetType() as NullableType; 1902Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1903Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1913Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1914Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1916if (expr1.Type is NullableType || expr2.Type is NullableType) 1926if (!(nonLiftedArg1.Type is NullableType) && !(nonLiftedArg2.Type is NullableType)) 2092CType nonNullableType1 = arg1.Type is NullableType arg1NubType ? arg1NubType.UnderlyingType : arg1.Type; 2093CType nonNullableType2 = arg2.Type is NullableType arg2NubType ? arg2NubType.UnderlyingType : arg2.Type; 2103NullableType typeDst = TypeManager.GetNullable(GetEnumBinOpType(ek, nonNullableType1, nonNullableType2, out AggregateType typeEnum)); 2114NullableType typeOp = TypeManager.GetNullable(GetPredefindType(ptOp)); 2429if (type is NullableType nt)
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (2)
43typeThru is NullableType); 129typeThru is NullableType);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (3)
74if (pDerived is NullableType derivedNub) 292return pDest.IsReferenceType || pDest is NullableType; 433if (pSource is NullableType nubSource)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (7)
426else if (typeL is NullableType nubL && nubL.UnderlyingType.IsEnumType) 440else if (typeR is NullableType nubR && nubR.UnderlyingType.IsEnumType) 447if (typeL is NullableType nubL2 && nubL2.UnderlyingType == typeR) 451if (typeR is NullableType nubR2 && nubR2.UnderlyingType == typeL) 495Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 1019pType is NullableType && pType.StripNubs() is AggregateType agg && agg.OwningAggregate.IsValueType(); 1024return pExpr is ExprProperty prop && prop.MemberGroup.OptionalObject == pObject && pObject.Type is NullableType;
Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs (4)
43if (type is NullableType nub) 237else if (arg is NullableType nubArg && SymbolLoader.HasBaseConversion(nubArg.UnderlyingType, typeBnd)) // This is inlining FBoxingConv 332typeBnd = ((NullableType)typeBnd).GetAts(); 348arg = ((NullableType)arg).GetAts();
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (5)
155public static NullableType GetNullable(CType pUnderlyingType) 157Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable"); 159NullableType pNullableType = TypeTable.LookupNullable(pUnderlyingType); 295typeDst = SubstTypeCore(typeSrc = ((NullableType)type).UnderlyingType, pctx); 683Debug.Assert(typeSrc is NullableType);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs (5)
62private static readonly Dictionary<CType, NullableType> s_nullableTable = new Dictionary<CType, NullableType>(); 122public static NullableType LookupNullable(CType underlyingType) 124s_nullableTable.TryGetValue(underlyingType, out NullableType result); 128public static void InsertNullable(CType underlyingType, NullableType nullable)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
108if (type is NullableType nub)