1 instantiation of NullableType
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
157pNullableType = new NullableType(pUnderlyingType);
88 references to NullableType
Microsoft.CSharp (88)
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (1)
526ErrAppendType(((NullableType)pType).UnderlyingType, null);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
529else if (callingObjectType is NullableType callingNub)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (7)
319if (!(type1 is NullableType nub1) || !(type2 is NullableType nub2) || 326PredefinedType pt1 = (type1 as NullableType).UnderlyingType.PredefinedType; 327PredefinedType pt2 = (type2 as NullableType).UnderlyingType.PredefinedType; 990if (ctypeLiftBest > 0 && !(typeFrom is NullableType) && fDstHasNull) 1017NullableType pConversionNubSourceType = TypeManager.GetNullable(typeFrom); 1023if (typeTo is NullableType)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (1)
326public static bool FWrappingConv(CType typeSrc, CType typeDst) => typeDst is NullableType nubDst && typeSrc == nubDst.UnderlyingType;
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (3)
110if (_typeDest is NullableType) 116if (_typeSrc is NullableType) 199if (valueSrc.Type is NullableType)
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (5)
602NullableType nubParam; 655if (!(arg.Type is NullableType) || !canConvert(arg.Type.StripNubs(), typeRaw, CONVERTTYPE.NOUDC)) 660Debug.Assert(arg.Type is NullableType); 663if (!(typeRet is NullableType)) 992if (typeObj is NullableType nubTypeObj && (typeTmp = nubTypeObj.GetAts()) != swt.GetType())
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (1)
522else if ((pParamType.IsReferenceType || pParamType is NullableType) && cv.IsNullRef)
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (4)
127if (_typeDest is NullableType nubDest) 132if (_typeSrc is NullableType nubSrc) 264private bool BindNubConversion(NullableType nubDst) 421private bool bindImplicitConversionFromNullable(NullableType nubSrc)
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (2)
838if (!(pSource is NullableType nubSource) || !(pDest is NullableType nubDest))
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (4)
41Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 51NullableType nubSrc = (NullableType)exprSrc.Type; 67NullableType pNubSourceType = TypeManager.GetNullable(exprSrc.Type);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (32)
460if (info.type1 is NullableType && info.type2 is NullType) 465if (info.type1 is NullType && info.type2 is NullableType) 605Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 639if (!(resultType is NullableType)) 667if (pParameterType is NullableType paramNub) 737Debug.Assert(!(typeDst is NullableType)); 751if (info.type2 is NullableType) 770Debug.Assert(!(typeDst is NullableType)); 786if (info.type1 is NullableType) 811Debug.Assert(info.type1 is NullableType); 822Debug.Assert(info.type2 is NullableType); 1160if (type is NullableType nub) 1475if (typeSig is NullableType) 1515NullableType type = uofs.GetType() as NullableType; 1711Debug.Assert(!(type is NullableType)); 1734NullableType type = uofs.GetType() as NullableType; 1859Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1860Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1869Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1870Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1872if (expr1.Type is NullableType || expr2.Type is NullableType) 1882if (!(nonLiftedArg1.Type is NullableType) && !(nonLiftedArg2.Type is NullableType)) 2042CType nonNullableType1 = arg1.Type is NullableType arg1NubType ? arg1NubType.UnderlyingType : arg1.Type; 2043CType nonNullableType2 = arg2.Type is NullableType arg2NubType ? arg2NubType.UnderlyingType : arg2.Type; 2053NullableType typeDst = TypeManager.GetNullable(GetEnumBinOpType(ek, nonNullableType1, nonNullableType2, out AggregateType typeEnum)); 2064NullableType typeOp = TypeManager.GetNullable(GetPredefindType(ptOp)); 2372if (type is NullableType nt)
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (2)
41typeThru is NullableType); 125typeThru is NullableType);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (3)
69if (pDerived is NullableType derivedNub) 283return pDest.IsReferenceType || pDest is NullableType; 419if (pSource is NullableType nubSource)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (7)
425else if (typeL is NullableType nubL && nubL.UnderlyingType.IsEnumType) 439else if (typeR is NullableType nubR && nubR.UnderlyingType.IsEnumType) 446if (typeL is NullableType nubL2 && nubL2.UnderlyingType == typeR) 450if (typeR is NullableType nubR2 && nubR2.UnderlyingType == typeL) 494Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 1018pType is NullableType && pType.StripNubs() is AggregateType agg && agg.OwningAggregate.IsValueType(); 1023return pExpr is ExprProperty prop && prop.MemberGroup.OptionalObject == pObject && pObject.Type is NullableType;
Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs (4)
42if (type is NullableType nub) 233else if (arg is NullableType nubArg && SymbolLoader.HasBaseConversion(nubArg.UnderlyingType, typeBnd)) // This is inlining FBoxingConv 327typeBnd = ((NullableType)typeBnd).GetAts(); 343arg = ((NullableType)arg).GetAts();
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (5)
150public static NullableType GetNullable(CType pUnderlyingType) 152Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable"); 154NullableType pNullableType = TypeTable.LookupNullable(pUnderlyingType); 281typeDst = SubstTypeCore(typeSrc = ((NullableType)type).UnderlyingType, pctx); 657Debug.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)
106if (type is NullableType nub)