117 references to IsNullableType
System.Linq.Expressions (117)
System\Dynamic\Utils\TypeUtils.cs (8)
22
public static Type GetNonNullableType(this Type type) =>
IsNullableType
(type) ? type.GetGenericArguments()[0] : type;
28
if (type.IsValueType && !
IsNullableType
(type))
46
if (!type.IsValueType ||
IsNullableType
(type))
95
Debug.Assert(nullableType.
IsNullableType
());
102
public static bool IsNullableOrReferenceType(this Type type) => !type.IsValueType ||
IsNullableType
(type);
299
if (
IsNullableType
(source) && AreEquivalent(dest, GetNonNullableType(source)))
304
if (
IsNullableType
(dest) && AreEquivalent(source, GetNonNullableType(dest)))
863
IsNullableType
(destination) && IsImplicitlyConvertibleTo(GetNonNullableType(source), GetNonNullableType(destination));
System\Linq\Expressions\BinaryExpression.cs (31)
290
if (Left.Type.
IsNullableType
())
303
public bool IsLiftedToNull => IsLifted && Type.
IsNullableType
();
344
left.
IsNullableType
() &&
611
if (left.Type.
IsNullableType
() && right.Type.
IsNullableType
())
616
if (method != null && method.ReturnType.IsValueType && !method.ReturnType.
IsNullableType
())
645
if (left.Type.
IsNullableType
() && right.Type.
IsNullableType
() &&
648
method.ReturnType.IsValueType && !method.ReturnType.
IsNullableType
())
739
return right.
IsNullableType
() &&
740
left.
IsNullableType
() &&
755
if (paramType.
IsNullableType
() && !operandType.
IsNullableType
())
784
? !IsNullConstant(right) && right.Type.
IsNullableType
()
785
: IsNullConstant(right) && left.Type.
IsNullableType
();
807
if (!(left.
IsNullableType
() && ParameterIsAssignable(pms[0], left.GetNonNullableType())))
812
if (!(right.
IsNullableType
() && ParameterIsAssignable(pms[1], right.GetNonNullableType())))
851
if (!(left.
IsNullableType
() && ParameterIsAssignable(pmsOpTrue[0], left.GetNonNullableType())))
859
right.
IsNullableType
() &&
1059
if (left.Type.
IsNullableType
() && liftToNull)
1076
if (left.Type.
IsNullableType
() && liftToNull)
1229
if (left.Type.
IsNullableType
() && liftToNull)
1288
returnType = (left.Type.
IsNullableType
() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType;
1294
returnType = (left.Type.
IsNullableType
() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType;
1341
returnType = (left.Type.
IsNullableType
() && method.ReturnType == left.Type.GetNonNullableType()) ? left.Type : method.ReturnType;
1347
returnType = (left.Type.
IsNullableType
() && method.ReturnType == left.Type.GetNonNullableType()) ? left.Type : method.ReturnType;
1387
if (left.Type.IsValueType && !left.Type.
IsNullableType
())
1426
if (left.IsValueType && !left.
IsNullableType
())
1430
else if (left.
IsNullableType
() && right.IsImplicitlyConvertibleTo(leftStripped))
2238
if (!left.
IsNullableType
() && right.
IsNullableType
())
System\Linq\Expressions\Common\ConstantCheck.cs (1)
84
if (operandType.IsValueType && !operandType.
IsNullableType
())
System\Linq\Expressions\Compiler\ILGen.cs (17)
486
if (type.
IsNullableType
())
561
bool isTypeFromNullable = typeFrom.
IsNullableType
();
562
bool isTypeToNullable = typeTo.
IsNullableType
();
789
Debug.Assert(typeFrom.
IsNullableType
());
790
Debug.Assert(typeTo.
IsNullableType
());
823
Debug.Assert(!typeFrom.
IsNullableType
());
824
Debug.Assert(typeTo.
IsNullableType
());
833
Debug.Assert(typeFrom.
IsNullableType
());
834
Debug.Assert(!typeTo.
IsNullableType
());
844
Debug.Assert(typeFrom.
IsNullableType
());
845
Debug.Assert(!typeTo.
IsNullableType
());
859
Debug.Assert(typeFrom.
IsNullableType
());
868
bool isTypeFromNullable = typeFrom.
IsNullableType
();
869
bool isTypeToNullable = typeTo.
IsNullableType
();
881
Debug.Assert(nullableType.
IsNullableType
());
890
Debug.Assert(nullableType.
IsNullableType
());
899
Debug.Assert(nullableType.
IsNullableType
());
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (12)
42
if (ConstantCheck.IsNull(b.Left) && !ConstantCheck.IsNull(b.Right) && b.Right.Type.
IsNullableType
())
47
if (ConstantCheck.IsNull(b.Right) && !ConstantCheck.IsNull(b.Left) && b.Left.Type.
IsNullableType
())
71
Debug.Assert(e.Type.
IsNullableType
());
137
else if (leftType.
IsNullableType
() || rightType.
IsNullableType
())
150
Debug.Assert(!leftType.
IsNullableType
());
151
Debug.Assert(!rightType.
IsNullableType
());
268
Debug.Assert(!resultType.
IsNullableType
());
289
Debug.Assert(leftType.
IsNullableType
() || rightType.
IsNullableType
());
419
bool leftIsNullable = leftType.
IsNullableType
();
420
bool rightIsNullable = rightType.
IsNullableType
();
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (5)
674
if (type.
IsNullableType
())
1133
if (arg.Type.
IsNullableType
())
1162
if (resultType.
IsNullableType
() && !TypeUtils.AreEquivalent(resultType, mc.Type))
1220
if (arg.Type.
IsNullableType
())
1266
if (resultType.
IsNullableType
() && !TypeUtils.AreEquivalent(resultType, mc.Type))
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (5)
91
if (b.Left.Type.
IsNullableType
())
523
if (node.Right.Type.
IsNullableType
())
537
if (node.Left.Type.
IsNullableType
())
549
else if (node.Left.Type.
IsNullableType
() || node.Right.Type.
IsNullableType
())
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (4)
76
if (type.
IsNullableType
())
122
bool operandIsNullable = operandType.
IsNullableType
();
141
if (resultType.
IsNullableType
())
228
if (resultType.
IsNullableType
())
System\Linq\Expressions\ConstantExpression.cs (1)
106
if (!type.IsValueType || type.
IsNullableType
())
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (1)
18
Debug.Assert(!type.
IsNullableType
());
System\Linq\Expressions\Interpreter\LightCompiler.cs (15)
966
? !IsNullConstant(right) && right.Type.
IsNullableType
()
967
: IsNullConstant(right) && left.Type.
IsNullableType
();
1069
if (!operandType.IsValueType || operandType.
IsNullableType
() && node.IsLiftedToNull)
1078
if (operandType.
IsNullableType
() && parameterType.Equals(operandType.GetNonNullableType()))
1123
typeTo.
IsNullableType
() &&
1131
typeFrom.
IsNullableType
() &&
1168
if (typeFrom.
IsNullableType
() && !typeTo.
IsNullableType
())
2179
@object.Type.
IsNullableType
())
2427
if (type.
IsNullableType
())
2498
(from != null && from.Type.
IsNullableType
()))
2597
if (!hasConversion && node.Left.Type.
IsNullableType
())
2605
if (!node.Type.
IsNullableType
())
2635
CompileConvertToType(node.Right.Type, node.Type, isChecked: true, isLiftedToNull: node.Type.
IsNullableType
());
2892
if (node.Type.IsValueType && !node.Type.
IsNullableType
())
System\Linq\Expressions\Interpreter\LocalAccess.cs (2)
388
frame.Data[_index] = _type.
IsNullableType
() ?
429
value = _type.
IsNullableType
() ?
System\Linq\Expressions\Interpreter\TypeOperations.cs (2)
154
Debug.Assert(!mi.ReturnType.
IsNullableType
());
288
if (t.IsValueType && !t.
IsNullableType
())
System\Linq\Expressions\SwitchExpression.cs (2)
72
if (SwitchValue.Type.
IsNullableType
())
230
if (!rightOperandType.
IsNullableType
())
System\Linq\Expressions\TypeBinaryExpression.cs (1)
55
if (cType.
IsNullableType
())
System\Linq\Expressions\UnaryExpression.cs (10)
62
bool operandIsNullable = Operand.Type.
IsNullableType
();
63
bool resultIsNullable = this.Type.
IsNullableType
();
77
public bool IsLiftedToNull => IsLifted && this.Type.
IsNullableType
();
368
if (operandType.
IsNullableType
())
372
if (method != null && method.ReturnType.IsValueType && !method.ReturnType.
IsNullableType
())
393
if (operand.Type.
IsNullableType
() &&
395
method.ReturnType.IsValueType && !method.ReturnType.
IsNullableType
())
440
if ((operand.Type.
IsNullableType
() || convertToType.
IsNullableType
()) &&
695
if (type.IsValueType && !type.
IsNullableType
())