src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (12)
83public static bool IsSpecialType([NotNullWhen(true)] ITypeSymbol? type, SpecialType specialType)
136SpecialType.System_SByte => value is sbyte,
137SpecialType.System_Byte => value is byte,
138SpecialType.System_Int16 => value is short,
139SpecialType.System_UInt16 => value is ushort,
140SpecialType.System_Int32 => value is int,
141SpecialType.System_UInt32 => value is uint,
142SpecialType.System_Int64 => value is long,
143SpecialType.System_UInt64 => value is ulong,
144SpecialType.System_Decimal => value is decimal,
145SpecialType.System_Single => value is float,
146SpecialType.System_Double => value is double,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
34SpecialType specialType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
39SpecialType specialType,
Binder\Binder_Expressions.cs (72)
1037if (boundArgument.Type?.SpecialType == SpecialType.System_Void)
1220TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1244TypeSymbol typedReferenceType = GetSpecialType(SpecialType.System_TypedReference, diagnostics, node);
1268TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1310TypeSymbol runtimeArgumentHandleType = GetSpecialType(SpecialType.System_RuntimeArgumentHandle, diagnostics, node);
1435this.GetSpecialType(SpecialType.System_Int32, diagnostics, node), hasErrors);
2592GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2595TypeSymbol intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
2602NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2680GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2682NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2709NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, operand);
4353this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)),
4454GetSpecialType(SpecialType.System_Int32, diagnostics, nonNullSyntax))
4535count = GenerateConversionForAssignment(GetSpecialType(SpecialType.System_Int32, diagnostics, node), count, diagnostics);
4679GetSpecialType(SpecialType.System_Int32, diagnostics, node))
4700if (constantValue == null || constantValue.IsBad || expression.Type.SpecialType != SpecialType.System_Int32)
4723var type = expression.Type.SpecialType;
4724if (type == SpecialType.System_Int32)
4729if (type == SpecialType.System_Int64)
4736Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64);
4840containingType.SpecialType == SpecialType.System_Object ||
4843if ((object)initializerType == null || containingType.SpecialType == SpecialType.System_Object) //e.g. when defining System.Object in source
5091if (baseType.SpecialType == SpecialType.System_Object)
5093if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object)
5292lengthOrCount = new BoundLiteral(expression.Syntax, ConstantValue.Create(length), @this.GetSpecialType(SpecialType.System_Int32, diagnostics, expression.Syntax)) { WasCompilerGenerated = true };
6283NamedTypeSymbol collectionsIEnumerableType = this.GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, node);
6464type: GetSpecialType(SpecialType.System_Void, diagnostics, elementInitializer),
7286var specialType = type.SpecialType;
7295case SpecialType.System_SByte:
7296case SpecialType.System_Int16:
7297case SpecialType.System_Int32:
7298case SpecialType.System_Int64:
7299case SpecialType.System_Byte:
7300case SpecialType.System_UInt16:
7301case SpecialType.System_UInt32:
7302case SpecialType.System_UInt64:
7303case SpecialType.System_Single:
7304case SpecialType.System_Double:
7305case SpecialType.System_Decimal:
7306case SpecialType.System_Boolean:
7307case SpecialType.System_Char:
7352specialType != SpecialType.None &&
7353specialType != SpecialType.System_Byte &&
7354specialType != SpecialType.System_SByte &&
7355specialType != SpecialType.System_Int16 &&
7356specialType != SpecialType.System_UInt16);
7383var type = GetWellKnownType(WellKnownType.System_ReadOnlySpan_T, diagnostics, node).Construct(GetSpecialType(SpecialType.System_Byte, diagnostics, node));
9099BoundExpression convertedIndex = TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics);
9187if (convertedIndex.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex })
9268if (hatExpression.Operand.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex })
9274else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand })
9281arguments[0] is { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex1 } } index &&
9282arguments[1] is { ConstantValueOpt: { SpecialType: SpecialType.System_Boolean, BooleanValue: bool isFromEnd } })
9403var int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
9438TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics) ??
9439TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt32, node, diagnostics) ??
9440TryImplicitConversionToArrayIndex(index, SpecialType.System_Int64, node, diagnostics) ??
9441TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt64, node, diagnostics);
9475NamedTypeSymbol int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
9509private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics)
10069original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
10071var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10087else if (receiver.Type.SpecialType == SpecialType.System_String)
10142var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10143var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10167original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } &&
10168original.Parameters[1] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None };
10230getMethod.ReturnType.SpecialType == SpecialType.System_Int32 &&
11050accessType = GetSpecialType(SpecialType.System_Void, diagnostics, node);
11058accessType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node).Construct(accessType);
Binder\Binder_InterpolatedString.cs (18)
41var stringType = GetSpecialType(SpecialType.System_String, diagnostics, node);
55var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
167var constantValue = ConstantValue.Create(text, SpecialType.System_String);
219Debug.Assert(unconvertedInterpolatedString.Type?.SpecialType == SpecialType.System_String);
245Debug.Assert(unconvertedInterpolatedString.Parts.All(static part => part.Type is null or { SpecialType: SpecialType.System_String }));
304fillin.Value.Type?.SpecialType != SpecialType.System_String ||
414expressions[0] = new BoundLiteral(syntax, ConstantValue.Create(formatString.ToStringAndFree()), GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_String, diagnostics, syntax)) { WasCompilerGenerated = true };
436=> parts.All(p => p is BoundLiteral or BoundStringInsert { Value.Type.SpecialType: SpecialType.System_String, Alignment: null, Format: null });
517var @string = GetSpecialType(SpecialType.System_String, diagnostics, rootSyntax);
674TypeSymbol objectType = GetSpecialType(SpecialType.System_Object, diagnostics, syntax);
711var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, syntax);
722var boolType = GetSpecialType(SpecialType.System_Boolean, diagnostics, syntax);
853var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, unconvertedInterpolatedString.Syntax);
887Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String }, ConstantValueOpt.IsString: true });
985bool methodReturnsBool = returnType.SpecialType == SpecialType.System_Boolean;
986if (!methodReturnsBool && returnType.SpecialType != SpecialType.System_Void)
998var expected = builderPatternExpectsBool == true ? Compilation.GetSpecialType(SpecialType.System_Boolean) : Compilation.GetSpecialType(SpecialType.System_Void);
Binder\Binder_Invocation.cs (13)
269TypeSymbol objType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
1366Debug.Assert(parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object);
1628defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
1633defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1638defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1642&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists
1647defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1652if (parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object)
1672if (InAttributeArgument && parameterType.SpecialType == SpecialType.System_Object)
1683if (!conversion.IsValid && defaultConstantValue is { SpecialType: SpecialType.System_Decimal or SpecialType.System_DateTime })
1724TypeSymbol int32Type = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
2247return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
Binder\Binder_Lookup.cs (10)
970var iFaceSpecial = iFaceOriginal.SpecialType;
973return iFaceSpecial == SpecialType.System_Collections_Generic_IEnumerable_T ||
974iFaceSpecial == SpecialType.System_Collections_Generic_IList_T ||
975iFaceSpecial == SpecialType.System_Collections_Generic_ICollection_T ||
977iFaceSpecial == SpecialType.System_Collections_Generic_IReadOnlyList_T ||
978iFaceSpecial == SpecialType.System_Collections_Generic_IReadOnlyCollection_T ||
980iFaceSpecial == SpecialType.System_Collections_IEnumerable ||
1161this.LookupMembersInClass(tmp, this.Compilation.GetSpecialType(SpecialType.System_Object), name, arity, basesBeingResolved, options, originalBinder, type, diagnose, ref useSiteInfo);
1254hiddenContainer.SpecialType != SpecialType.System_Object)
2029this.AddMemberLookupSymbolsInfoInClass(result, Compilation.GetSpecialType(SpecialType.System_Object), options, originalBinder, accessThroughType);
Binder\Binder_Operators.cs (42)
289type = this.GetSpecialType(SpecialType.System_Void, diagnostics, node); //we know the return type would have been void
322type = this.GetSpecialType(SpecialType.System_Void, diagnostics, node);
542return new BoundLiteral(node, ConstantValue.Create(kind == BinaryOperatorKind.Equal), GetSpecialType(SpecialType.System_Boolean, diagnostics, node));
557Debug.Assert(right.Type.SpecialType == SpecialType.System_String);
737GetSpecialType(SpecialType.System_Boolean, diagnostics, node));
883namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte;
936if ((object)left.Type != null && left.Type.SpecialType == SpecialType.System_Boolean &&
937(object)right.Type != null && right.Type.SpecialType == SpecialType.System_Boolean)
987bool bothBool = signature.LeftType.SpecialType == SpecialType.System_Boolean &&
988signature.RightType.SpecialType == SpecialType.System_Boolean;
1066var booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean);
1305return GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
1456(operand.Type.SpecialType == SpecialType.System_UInt64 || isNuint(operand.Type)))
1487return type.SpecialType == SpecialType.System_UIntPtr
1690internal static SpecialType GetEnumPromotedType(SpecialType underlyingType)
1694case SpecialType.System_Byte:
1695case SpecialType.System_SByte:
1696case SpecialType.System_Int16:
1697case SpecialType.System_UInt16:
1698return SpecialType.System_Int32;
1700case SpecialType.System_Int32:
1701case SpecialType.System_UInt32:
1702case SpecialType.System_Int64:
1703case SpecialType.System_UInt64:
1740SpecialType operandSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
1766Debug.Assert(resultTypeSymbol.SpecialType == SpecialType.System_Boolean);
1775if (resultTypeSymbol.SpecialType != SpecialType.System_Boolean && constantValue != null && !constantValue.IsBad)
1835SpecialType resultType = resultTypeSymbol.SpecialType;
2824var upconvertSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
2873SpecialType resultType = resultTypeSymbol.SpecialType;
3109return new BoundLiteral(node, ConstantValue.Create((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node));
3124return new BoundLiteral(node, ConstantValue.Create(-9223372036854775808), GetSpecialType(SpecialType.System_Int64, diagnostics, node));
3224var resultType = (TypeSymbol)GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3321GetSpecialType(SpecialType.System_Object, diagnostics, node).Name // a pretty way of getting the string "Object"
3330operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3515if (operandType.IsValueType && targetType.IsClassType() && targetType.SpecialType != SpecialType.System_Enum ||
3516targetType.IsValueType && operandType.IsClassType() && operandType.SpecialType != SpecialType.System_Enum)
3799type: GetSpecialType(SpecialType.System_Object, diagnostics, node));
3817operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3824targetType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
4054var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
Binder\Binder_Patterns.cs (28)
41node, expression, pattern, GetSpecialType(SpecialType.System_Boolean, diagnostics, node),
428if (convertedType.SpecialType == SpecialType.System_String && inputType.IsSpanOrReadOnlySpanChar())
448bool isExplicitNotNullTest = boundType.Type.SpecialType == SpecialType.System_Object;
562strippedInputType.SpecialType is not SpecialType.System_Object and not SpecialType.System_ValueType)
652if (expression.Type?.SpecialType == SpecialType.System_String && inputType.IsSpanOrReadOnlySpanChar())
824expressionType = conversions.CorLibrary.GetSpecialType(SpecialType.System_Object);
1114var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1141var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1260if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) &&
1490if (memberType.SpecialType == SpecialType.System_Int32 &&
1619bool isExplicitNotNullTest = patternType.Type.SpecialType == SpecialType.System_Object;
1697SpecialType.System_Single => BinaryOperatorKind.Float,
1698SpecialType.System_Double => BinaryOperatorKind.Double,
1699SpecialType.System_Char => BinaryOperatorKind.Char,
1700SpecialType.System_SByte => BinaryOperatorKind.Int, // operands are converted to int
1701SpecialType.System_Byte => BinaryOperatorKind.Int, // operands are converted to int
1702SpecialType.System_UInt16 => BinaryOperatorKind.Int, // operands are converted to int
1703SpecialType.System_Int16 => BinaryOperatorKind.Int, // operands are converted to int
1704SpecialType.System_Int32 => BinaryOperatorKind.Int,
1705SpecialType.System_UInt32 => BinaryOperatorKind.UInt,
1706SpecialType.System_Int64 => BinaryOperatorKind.Long,
1707SpecialType.System_UInt64 => BinaryOperatorKind.ULong,
1708SpecialType.System_Decimal => BinaryOperatorKind.Decimal,
1709SpecialType.System_String => BinaryOperatorKind.String,
1710SpecialType.System_Boolean => BinaryOperatorKind.Bool,
1711SpecialType.System_IntPtr when type.IsNativeIntegerType => BinaryOperatorKind.NInt,
1712SpecialType.System_UIntPtr when type.IsNativeIntegerType => BinaryOperatorKind.NUInt,
Binder\Binder_Statements.cs (11)
1278if (initializerType.SpecialType == SpecialType.System_String &&
1279((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String))
1282elementType = this.GetSpecialType(SpecialType.System_Char, diagnostics, initializerSyntax);
1529type = this.GetSpecialType(SpecialType.System_Void, diagnostics, node);
2260if (sourceType.SpecialType == SpecialType.System_Double && syntax.Kind() == SyntaxKind.NumericLiteralExpression &&
2261(targetType.SpecialType == SpecialType.System_Single || targetType.SpecialType == SpecialType.System_Decimal))
2263Error(diagnostics, ErrorCode.ERR_LiteralDoubleCast, syntax, (targetType.SpecialType == SpecialType.System_Single) ? "F" : "M", targetType);
2656var boolean = GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3533else if (expression.Type?.SpecialType == SpecialType.System_Void)
3846if (baseType.SpecialType == SpecialType.System_Object)
Binder\Binder_Symbols.cs (8)
994node.IsNint ? SpecialType.System_IntPtr :
995node.IsNuint ? SpecialType.System_UIntPtr : SpecialType.None;
997if (specialType == SpecialType.None)
1060this.GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
1649internal NamedTypeSymbol GetSpecialType(SpecialType typeId, BindingDiagnosticBag diagnostics, SyntaxNode node)
1654internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, SyntaxNode node, BindingDiagnosticBag diagnostics)
1662internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, Location location, BindingDiagnosticBag diagnostics)
Binder\DecisionDagBuilder.cs (56)
326var objectType = this._compilation.GetSpecialType(SpecialType.System_Object);
328RoslynDebug.Assert(getLengthProperty.Type.SpecialType == SpecialType.System_Int32);
342var lengthTemp = new BoundDagTemp(syntax, this._compilation.GetSpecialType(SpecialType.System_Int32), lengthEvaluation);
464if (input.Type.IsDynamic() ? type.SpecialType == SpecialType.System_Object : conversion.IsImplicit)
1564case (SpecialType.System_SByte, SpecialType.System_Byte):
1565case (SpecialType.System_Byte, SpecialType.System_SByte):
1566case (SpecialType.System_Int16, SpecialType.System_UInt16):
1567case (SpecialType.System_UInt16, SpecialType.System_Int16):
1568case (SpecialType.System_Int32, SpecialType.System_UInt32):
1569case (SpecialType.System_UInt32, SpecialType.System_Int32):
1570case (SpecialType.System_Int64, SpecialType.System_UInt64):
1571case (SpecialType.System_UInt64, SpecialType.System_Int64):
1572case (SpecialType.System_IntPtr, SpecialType.System_UIntPtr):
1573case (SpecialType.System_UIntPtr, SpecialType.System_IntPtr):
1578case (SpecialType.System_Int32, SpecialType.System_IntPtr):
1579case (SpecialType.System_Int32, SpecialType.System_UIntPtr):
1580case (SpecialType.System_UInt32, SpecialType.System_IntPtr):
1581case (SpecialType.System_UInt32, SpecialType.System_UIntPtr):
1582case (SpecialType.System_IntPtr, SpecialType.System_Int32):
1583case (SpecialType.System_IntPtr, SpecialType.System_UInt32):
1584case (SpecialType.System_UIntPtr, SpecialType.System_Int32):
1585case (SpecialType.System_UIntPtr, SpecialType.System_UInt32):
1590case (SpecialType.System_Int64, SpecialType.System_IntPtr):
1591case (SpecialType.System_Int64, SpecialType.System_UIntPtr):
1592case (SpecialType.System_UInt64, SpecialType.System_IntPtr):
1593case (SpecialType.System_UInt64, SpecialType.System_UIntPtr):
1594case (SpecialType.System_IntPtr, SpecialType.System_Int64):
1595case (SpecialType.System_IntPtr, SpecialType.System_UInt64):
1596case (SpecialType.System_UIntPtr, SpecialType.System_Int64):
1597case (SpecialType.System_UIntPtr, SpecialType.System_UInt64):
Binder\ForEachLoopBinder.cs (22)
258if (!hasErrors && awaitInfo.GetResult?.ReturnType.SpecialType != SpecialType.System_Boolean)
576(collectionConversionClassification.Kind == ConversionKind.ExplicitReference && collectionExpr.Type.SpecialType == SpecialType.System_String));
684else if (collectionExpr.Type.SpecialType == SpecialType.System_String && builder.CollectionType.SpecialType == SpecialType.System_Collections_IEnumerable)
690inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax));
999if (!isAsync && collectionExprType.SpecialType == SpecialType.System_String)
1063this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T));
1101Debug.Assert(collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
1160Debug.Assert(collectionType.SpecialType == SpecialType.System_Collections_IEnumerable);
1165builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax));
1168builder.GetEnumeratorInfo.Method.ReturnType.SpecialType == SpecialType.System_Collections_IEnumerator);
1261NamedTypeSymbol targetInterface = isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable);
1283builder.CollectionType = GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, syntax);
1290GetSpecialType(SpecialType.System_Object, diagnostics, syntax));
1294builder.ElementTypeWithAnnotations = collectionExprType.SpecialType == SpecialType.System_String ?
1295TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, syntax)) :
1307TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1709return moveNextMethodCandidate.OriginalDefinition.ReturnType.SpecialType != SpecialType.System_Boolean;
1727case SpecialType.System_Collections_IEnumerable:
1728case SpecialType.System_Collections_Generic_IEnumerable_T:
1769var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable);
1848return type.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T;
Binder\PatternExplainer.cs (28)
674if (underlyingType.SpecialType == SpecialType.System_IntPtr)
682else if (underlyingType.SpecialType == SpecialType.System_UIntPtr)
700SpecialType.System_Int32 => true,
701SpecialType.System_Int64 => true,
702SpecialType.System_UInt32 => true,
703SpecialType.System_UInt64 => true,
704SpecialType.System_String => true,
705SpecialType.System_Decimal => true,
706SpecialType.System_Single => true,
707SpecialType.System_Double => true,
708SpecialType.System_Boolean => true,
709SpecialType.System_Char => true,
721case SpecialType.System_Boolean:
722case SpecialType.System_Byte:
723case SpecialType.System_SByte:
724case SpecialType.System_UInt16:
725case SpecialType.System_Int16:
726case SpecialType.System_Int32:
727case SpecialType.System_UInt32:
728case SpecialType.System_UInt64:
729case SpecialType.System_Int64:
730case SpecialType.System_IntPtr when type.IsNativeIntegerType:
731case SpecialType.System_UIntPtr when type.IsNativeIntegerType:
732case SpecialType.System_Decimal:
733case SpecialType.System_Char:
734case SpecialType.System_String:
737case SpecialType.System_Single:
746case SpecialType.System_Double:
Binder\Semantics\Conversions\ConversionsBase.cs (85)
250var sourceIsVoid = source?.SpecialType == SpecialType.System_Void;
251var destIsVoid = destination.SpecialType == SpecialType.System_Void;
1363var specialSource = source.Type.GetSpecialTypeSafe();
1365if (specialSource == SpecialType.System_Int32)
1371case SpecialType.System_Byte:
1373case SpecialType.System_SByte:
1375case SpecialType.System_Int16:
1377case SpecialType.System_IntPtr when destination.IsNativeIntegerType:
1379case SpecialType.System_UInt32:
1380case SpecialType.System_UIntPtr when destination.IsNativeIntegerType:
1382case SpecialType.System_UInt64:
1384case SpecialType.System_UInt16:
1390else if (specialSource == SpecialType.System_Int64 && destination.GetSpecialTypeSafe() == SpecialType.System_UInt64 && (constantValue.IsBad || 0 <= constantValue.Int64Value))
1619var multicastDelegateType = corLibrary.GetSpecialType(SpecialType.System_MulticastDelegate);
1679else if (implementsSpecialInterface(compilation, destination, SpecialType.System_Collections_IEnumerable))
1698static bool implementsSpecialInterface(CSharpCompilation compilation, TypeSymbol targetType, SpecialType specialInterface)
1756TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_Int32);
1783TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_String);
2101case SpecialType.System_Char:
2102case SpecialType.System_SByte:
2103case SpecialType.System_Byte:
2104case SpecialType.System_Int16:
2105case SpecialType.System_UInt16:
2106case SpecialType.System_Int32:
2107case SpecialType.System_UInt32:
2108case SpecialType.System_Int64:
2109case SpecialType.System_UInt64:
2110case SpecialType.System_Single:
2111case SpecialType.System_Double:
2112case SpecialType.System_Decimal:
2113case SpecialType.System_IntPtr when type.IsNativeIntegerType:
2114case SpecialType.System_UIntPtr when type.IsNativeIntegerType:
2186case SpecialType.System_SByte:
2187case SpecialType.System_Byte:
2188case SpecialType.System_Int16:
2189case SpecialType.System_UInt16:
2190case SpecialType.System_Char:
2191case SpecialType.System_Int32:
2192case SpecialType.System_UInt32:
2193case SpecialType.System_Int64:
2194case SpecialType.System_UInt64:
2195case SpecialType.System_Double:
2196case SpecialType.System_Single:
2197case SpecialType.System_Decimal:
2204(type.SpecialType == SpecialType.System_IntPtr || type.SpecialType == SpecialType.System_UIntPtr) && !type.IsNativeIntegerType;
2573if (destination.SpecialType == SpecialType.System_Collections_IEnumerable)
2643if (destination.SpecialType == SpecialType.System_Object || destination.Kind == SymbolKind.DynamicType)
2737if (destination.GetSpecialTypeSafe() == SpecialType.System_Array)
2742if (IsBaseInterface(destination, this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Array), ref useSiteInfo))
2775var specialDestination = destination.GetSpecialTypeSafe();
2777if (specialDestination == SpecialType.System_MulticastDelegate ||
2778specialDestination == SpecialType.System_Delegate ||
2779IsBaseInterface(destination, this.corLibrary.GetDeclaredSpecialType(SpecialType.System_MulticastDelegate), ref useSiteInfo))
2808if (destination.SpecialType == SpecialType.System_MulticastDelegate)
2818var derivedType = this.corLibrary.GetDeclaredSpecialType(SpecialType.System_MulticastDelegate);
3371return source.IsPointerOrFunctionPointer() && destination is PointerTypeSymbol { PointedAtType: { SpecialType: SpecialType.System_Void } };
3462if (source.SpecialType == SpecialType.System_Object)
3640if (source.SpecialType == SpecialType.System_Delegate || source.SpecialType == SpecialType.System_MulticastDelegate)
3645if (HasImplicitConversionToInterface(this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Delegate), source, ref useSiteInfo))
3747if (source.SpecialType == SpecialType.System_Array)
3752foreach (var iface in this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Array).AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo))
3781var specialDefinition = ((TypeSymbol)source.OriginalDefinition).SpecialType;
3783if (specialDefinition == SpecialType.System_Collections_Generic_IList_T ||
3784specialDefinition == SpecialType.System_Collections_Generic_ICollection_T ||
3785specialDefinition == SpecialType.System_Collections_Generic_IEnumerable_T ||
3786specialDefinition == SpecialType.System_Collections_Generic_IReadOnlyList_T ||
3787specialDefinition == SpecialType.System_Collections_Generic_IReadOnlyCollection_T)
3830var specialTypeSource = source.SpecialType;
3832if (specialTypeSource == SpecialType.System_Object || specialTypeSource == SpecialType.System_ValueType)
3851if (source.SpecialType == SpecialType.System_Enum && destination.IsEnumType())
3924case SpecialType.System_SByte:
3925case SpecialType.System_Byte:
3926case SpecialType.System_Int16:
3927case SpecialType.System_UInt16:
3928case SpecialType.System_Int32:
3929case SpecialType.System_UInt32:
3930case SpecialType.System_Int64:
3931case SpecialType.System_UInt64:
3933case SpecialType.System_IntPtr:
3934case SpecialType.System_UIntPtr:
3992return spanElementType.SpecialType is SpecialType.System_Char;
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (26)
312operators.Add(new BinaryOperatorSignature(kind | BinaryOperatorKind.Delegate, delegateType, delegateType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
380TypeSymbol systemDelegateType = _binder.Compilation.GetSpecialType(SpecialType.System_Delegate);
476Debug.Assert(underlying.SpecialType != SpecialType.None);
527var boolean = Compilation.GetSpecialType(SpecialType.System_Boolean);
551operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
552operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndUIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
553operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndLongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
554operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndULongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
555operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.IntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType, pointerType));
556operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.UIntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType, pointerType));
557operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.LongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType, pointerType));
558operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.ULongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType, pointerType));
561operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
562operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndUIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
563operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndLongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
564operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndULongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
565operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerSubtraction, pointerType, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64)));
582var voidPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(Compilation.GetSpecialType(SpecialType.System_Void)));
583operators.Add(new BinaryOperatorSignature(kind | BinaryOperatorKind.Pointer, voidPointerType, voidPointerType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
768((object)left.Type == null || (!left.Type.IsDelegateType() && left.Type.SpecialType != SpecialType.System_String && left.Type.SpecialType != SpecialType.System_Delegate)) &&
769((object)right.Type == null || (!right.Type.IsDelegateType() && right.Type.SpecialType != SpecialType.System_String && right.Type.SpecialType != SpecialType.System_Delegate));
785var @object = Compilation.GetSpecialType(SpecialType.System_Object);
786operators.Add(new BinaryOperatorSignature(kind | BinaryOperatorKind.Object, @object, @object, Compilation.GetSpecialType(SpecialType.System_Boolean)));
1051return result.SpecialType == SpecialType.System_Boolean ?
CodeGen\EmitStatement.cs (8)
1050_module.GetSpecialType(SpecialType.System_Object, catchBlock.Syntax, _diagnostics.DiagnosticBag);
1308expression.Type.SpecialType == SpecialType.System_String || expression.Type.IsSpanOrReadOnlySpanChar());
1311if (expression.Type.SpecialType == SpecialType.System_String || expression.Type.IsSpanOrReadOnlySpanChar())
1393var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode, _diagnostics);
1418var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics);
1518var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode, _diagnostics);
1539var sequenceEqualsCharMethod = sequenceEqualsTMethod.Construct(Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics));
1799? _module.GetSpecialType(SpecialType.System_IntPtr, syntaxNode, _diagnostics.DiagnosticBag)
Compilation\BuiltInOperators.cs (54)
264case UnaryOperatorKind.SByte: opType = _compilation.GetSpecialType(SpecialType.System_SByte); break;
265case UnaryOperatorKind.Byte: opType = _compilation.GetSpecialType(SpecialType.System_Byte); break;
266case UnaryOperatorKind.Short: opType = _compilation.GetSpecialType(SpecialType.System_Int16); break;
267case UnaryOperatorKind.UShort: opType = _compilation.GetSpecialType(SpecialType.System_UInt16); break;
268case UnaryOperatorKind.Int: opType = _compilation.GetSpecialType(SpecialType.System_Int32); break;
269case UnaryOperatorKind.UInt: opType = _compilation.GetSpecialType(SpecialType.System_UInt32); break;
270case UnaryOperatorKind.Long: opType = _compilation.GetSpecialType(SpecialType.System_Int64); break;
271case UnaryOperatorKind.ULong: opType = _compilation.GetSpecialType(SpecialType.System_UInt64); break;
274case UnaryOperatorKind.Char: opType = _compilation.GetSpecialType(SpecialType.System_Char); break;
275case UnaryOperatorKind.Float: opType = _compilation.GetSpecialType(SpecialType.System_Single); break;
276case UnaryOperatorKind.Double: opType = _compilation.GetSpecialType(SpecialType.System_Double); break;
277case UnaryOperatorKind.Decimal: opType = _compilation.GetSpecialType(SpecialType.System_Decimal); break;
278case UnaryOperatorKind.Bool: opType = _compilation.GetSpecialType(SpecialType.System_Boolean); break;
693Debug.Assert(((NamedTypeSymbol)readonlySpanOfByte).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte);
720TypeSymbol rightType = _compilation.GetSpecialType(SpecialType.System_Int32);
733return new BinaryOperatorSignature(kind, left, left, _compilation.GetSpecialType(SpecialType.System_Boolean));
748case BinaryOperatorKind.Int: return _compilation.GetSpecialType(SpecialType.System_Int32);
749case BinaryOperatorKind.UInt: return _compilation.GetSpecialType(SpecialType.System_UInt32);
750case BinaryOperatorKind.Long: return _compilation.GetSpecialType(SpecialType.System_Int64);
751case BinaryOperatorKind.ULong: return _compilation.GetSpecialType(SpecialType.System_UInt64);
754case BinaryOperatorKind.Float: return _compilation.GetSpecialType(SpecialType.System_Single);
755case BinaryOperatorKind.Double: return _compilation.GetSpecialType(SpecialType.System_Double);
756case BinaryOperatorKind.Decimal: return _compilation.GetSpecialType(SpecialType.System_Decimal);
757case BinaryOperatorKind.Bool: return _compilation.GetSpecialType(SpecialType.System_Boolean);
760return _compilation.GetSpecialType(SpecialType.System_Object);
763return _compilation.GetSpecialType(SpecialType.System_String);
780case BinaryOperatorKind.Int: return _compilation.GetSpecialType(SpecialType.System_Int32);
781case BinaryOperatorKind.UInt: return _compilation.GetSpecialType(SpecialType.System_UInt32);
782case BinaryOperatorKind.Long: return _compilation.GetSpecialType(SpecialType.System_Int64);
783case BinaryOperatorKind.ULong: return _compilation.GetSpecialType(SpecialType.System_UInt64);
786case BinaryOperatorKind.Float: return _compilation.GetSpecialType(SpecialType.System_Single);
787case BinaryOperatorKind.Double: return _compilation.GetSpecialType(SpecialType.System_Double);
788case BinaryOperatorKind.Decimal: return _compilation.GetSpecialType(SpecialType.System_Decimal);
789case BinaryOperatorKind.Bool: return _compilation.GetSpecialType(SpecialType.System_Boolean);
792return _compilation.GetSpecialType(SpecialType.System_String);
795return _compilation.GetSpecialType(SpecialType.System_Object);
812case BinaryOperatorKind.Int: return _compilation.GetSpecialType(SpecialType.System_Int32);
813case BinaryOperatorKind.UInt: return _compilation.GetSpecialType(SpecialType.System_UInt32);
814case BinaryOperatorKind.Long: return _compilation.GetSpecialType(SpecialType.System_Int64);
815case BinaryOperatorKind.ULong: return _compilation.GetSpecialType(SpecialType.System_UInt64);
818case BinaryOperatorKind.Float: return _compilation.GetSpecialType(SpecialType.System_Single);
819case BinaryOperatorKind.Double: return _compilation.GetSpecialType(SpecialType.System_Double);
820case BinaryOperatorKind.Decimal: return _compilation.GetSpecialType(SpecialType.System_Decimal);
821case BinaryOperatorKind.Bool: return _compilation.GetSpecialType(SpecialType.System_Boolean);
822case BinaryOperatorKind.Object: return _compilation.GetSpecialType(SpecialType.System_Object);
826return _compilation.GetSpecialType(SpecialType.System_String);
839BinaryOperatorKind.Int => _compilation.GetSpecialType(SpecialType.System_Int32),
840BinaryOperatorKind.UInt => _compilation.GetSpecialType(SpecialType.System_UInt32),
841BinaryOperatorKind.Long => _compilation.GetSpecialType(SpecialType.System_Int64),
842BinaryOperatorKind.ULong => _compilation.GetSpecialType(SpecialType.System_UInt64),
845BinaryOperatorKind.Float => _compilation.GetSpecialType(SpecialType.System_Single),
846BinaryOperatorKind.Double => _compilation.GetSpecialType(SpecialType.System_Double),
847BinaryOperatorKind.Decimal => _compilation.GetSpecialType(SpecialType.System_Decimal),
848BinaryOperatorKind.Bool => _compilation.GetSpecialType(SpecialType.System_Boolean),
Emitter\Model\PEModuleBuilder.cs (19)
814private NamedTypeSymbol GetUntranslatedSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
818var typeSymbol = SourceModule.ContainingAssembly.GetSpecialType(specialType);
831internal sealed override Cci.INamedTypeReference GetSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
854return namedType.SpecialType == (SpecialType)platformType;
1084if ((object)declaredBase != null && declaredBase.SpecialType == SpecialType.System_ValueType)
1442return GetSpecialType(SpecialType.System_Object, syntaxNodeOpt, diagnostics);
1487return new SynthesizedPrivateImplementationDetailsStaticConstructor(GetPrivateImplClass(syntaxOpt, diagnostics), GetUntranslatedSpecialType(SpecialType.System_Void, syntaxOpt, diagnostics)).GetCciAdapter();
1578NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte);
1599NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte);
1622ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value)));
1662NamedTypeSymbol booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean);
1825TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1826TypeSymbol unmatchedValueType = factory.SpecialType(SpecialType.System_Object);
1872TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1892TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1906Debug.Assert(intType.SpecialType == SpecialType.System_Int32);
1975Debug.Assert(intType.SpecialType == SpecialType.System_Int32);
1992Debug.Assert(intType.SpecialType == SpecialType.System_Int32);
2008Debug.Assert(intType.SpecialType == SpecialType.System_Int32);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (15)
203inputType = _factory.SpecialType(SpecialType.System_Object);
243Debug.Assert(e.Property.GetMethod.Parameters[0].Type.SpecialType == SpecialType.System_Int32);
373TypeSymbol objectType = _factory.SpecialType(SpecialType.System_Object);
374var operandType = new PointerTypeSymbol(TypeWithAnnotations.Create(_factory.SpecialType(SpecialType.System_Void)));
380_factory.SpecialType(SpecialType.System_Boolean),
403if (input.Type.SpecialType == SpecialType.System_Double && double.IsNaN(value.DoubleValue) ||
404input.Type.SpecialType == SpecialType.System_Single && float.IsNaN(value.SingleValue))
412if (operatorKind.OperandTypes() == BinaryOperatorKind.Int && comparisonType.SpecialType != SpecialType.System_Int32)
417SpecialType.System_Byte => true,
418SpecialType.System_SByte => true,
419SpecialType.System_Int16 => true,
420SpecialType.System_UInt16 => true,
423comparisonType = _factory.SpecialType(SpecialType.System_Int32);
428return this._localRewriter.MakeBinaryOperator(_factory.Syntax, operatorKind, input, literal, _factory.SpecialType(SpecialType.System_Boolean), method: null, constrainedToTypeOpt: null);
439.Construct(_factory.SpecialType(SpecialType.System_Char));
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (116)
97Debug.Assert(byteType.SpecialType == SpecialType.System_Byte);
143Debug.Assert(byteArray.ElementType.SpecialType == SpecialType.System_Byte);
226if (type.SpecialType != SpecialType.System_Double && type.SpecialType != SpecialType.System_Single)
432if (rewrittenType.SpecialType == SpecialType.System_Decimal || rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
495if (rewrittenType.SpecialType == SpecialType.System_Decimal)
502else if (rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
601createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
606createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
760SpecialType GetUnderlyingSpecialType(TypeSymbol type) =>
763bool IsInRange(SpecialType type, SpecialType low, SpecialType high) =>
766SpecialType sourceST = GetUnderlyingSpecialType(source);
767SpecialType targetST = GetUnderlyingSpecialType(target);
772IsInRange(sourceST, SpecialType.System_Char, SpecialType.System_Double) &&
773IsInRange(targetST, SpecialType.System_Char, SpecialType.System_UInt64);
819rewrittenOperand.Type.SpecialType != SpecialType.System_Decimal &&
820rewrittenOperand.Type.SpecialType != SpecialType.System_DateTime)
1104if (!TypeSymbol.Equals(typeFrom, typeTo, TypeCompareKind.ConsiderEverything2) && (typeFrom.SpecialType == SpecialType.System_Decimal || typeTo.SpecialType == SpecialType.System_Decimal))
1541SpecialType t0Type = t0.IsEnumType() ? t0.GetEnumUnderlyingType()!.SpecialType : t0.SpecialType;
1542SpecialType s0Type = s0.IsEnumType() ? s0.GetEnumUnderlyingType()!.SpecialType : s0.SpecialType;
1544if (t0Type == SpecialType.System_IntPtr)
1553case SpecialType.System_Byte:
1554case SpecialType.System_SByte:
1555case SpecialType.System_Int16:
1556case SpecialType.System_UInt16:
1557case SpecialType.System_Char:
1558case SpecialType.System_Int32:
1560case SpecialType.System_UInt32:
1561case SpecialType.System_UInt64:
1562case SpecialType.System_Int64:
1563case SpecialType.System_Single:
1564case SpecialType.System_Double:
1565case SpecialType.System_Decimal:
1569else if (t0Type == SpecialType.System_UIntPtr)
1578case SpecialType.System_Byte:
1579case SpecialType.System_UInt16:
1580case SpecialType.System_Char:
1581case SpecialType.System_UInt32:
1583case SpecialType.System_SByte:
1584case SpecialType.System_Int16:
1585case SpecialType.System_Int32:
1586case SpecialType.System_UInt64:
1587case SpecialType.System_Int64:
1588case SpecialType.System_Single:
1589case SpecialType.System_Double:
1590case SpecialType.System_Decimal:
1594else if (s0Type == SpecialType.System_IntPtr)
1603case SpecialType.System_Byte:
1604case SpecialType.System_SByte:
1605case SpecialType.System_Int16:
1606case SpecialType.System_UInt16:
1607case SpecialType.System_Char:
1608case SpecialType.System_UInt32:
1609case SpecialType.System_Int32:
1611case SpecialType.System_UInt64:
1612case SpecialType.System_Int64:
1613case SpecialType.System_Single:
1614case SpecialType.System_Double:
1615case SpecialType.System_Decimal:
1619else if (s0Type == SpecialType.System_UIntPtr)
1628case SpecialType.System_SByte:
1629case SpecialType.System_Int16:
1630case SpecialType.System_Int32:
1631case SpecialType.System_Byte:
1632case SpecialType.System_UInt16:
1633case SpecialType.System_Char:
1634case SpecialType.System_UInt32:
1636case SpecialType.System_UInt64:
1637case SpecialType.System_Int64:
1638case SpecialType.System_Single:
1639case SpecialType.System_Double:
1640case SpecialType.System_Decimal:
1651if (typeFrom.SpecialType == SpecialType.System_Decimal)
1656case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Explicit_ToChar;
1657case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Explicit_ToSByte;
1658case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Explicit_ToByte;
1659case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Explicit_ToInt16;
1660case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Explicit_ToUInt16;
1661case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Explicit_ToInt32;
1662case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Explicit_ToUInt32;
1663case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Explicit_ToInt64;
1664case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Explicit_ToUInt64;
1665case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_ToSingle;
1666case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_ToDouble;
1676case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Implicit_FromChar;
1677case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Implicit_FromSByte;
1678case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Implicit_FromByte;
1679case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Implicit_FromInt16;
1680case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Implicit_FromUInt16;
1681case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Implicit_FromInt32;
1682case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Implicit_FromUInt32;
1683case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Implicit_FromInt64;
1684case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Implicit_FromUInt64;
1685case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_FromSingle;
1686case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_FromDouble;
1695Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal);
1697if (fromType.SpecialType == SpecialType.System_Decimal)
1701case SpecialType.System_IntPtr:
1702case SpecialType.System_UIntPtr:
1703operand = RewriteDecimalConversionCore(syntax, operand, fromType, get64BitType(_compilation, signed: toType.SpecialType == SpecialType.System_IntPtr), isImplicit, constantValueOpt);
1711case SpecialType.System_IntPtr:
1712case SpecialType.System_UIntPtr:
1713operand = MakeConversionNode(operand, get64BitType(_compilation, signed: fromType.SpecialType == SpecialType.System_IntPtr), @checked);
1721static TypeSymbol get64BitType(CSharpCompilation compilation, bool signed) => compilation.GetSpecialType(signed ? SpecialType.System_Int64 : SpecialType.System_UInt64);
1801if (fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal)
1816if (fromType.SpecialType == SpecialType.System_Decimal)
1829else if (toType.SpecialType == SpecialType.System_Decimal)
Lowering\LocalRewriter\LocalRewriter_Literal.cs (15)
30Debug.Assert(type is { SpecialType: SpecialType.System_Decimal });
38Debug.Assert(type is { SpecialType: SpecialType.System_DateTime });
73curMethod.ContainingType.SpecialType != SpecialType.System_Decimal) &&
100arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((int)value), _compilation.GetSpecialType(SpecialType.System_Int32)));
106arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((uint)value), _compilation.GetSpecialType(SpecialType.System_UInt32)));
112arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((long)value), _compilation.GetSpecialType(SpecialType.System_Int64)));
118arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((ulong)value), _compilation.GetSpecialType(SpecialType.System_UInt64)));
124arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(low), _compilation.GetSpecialType(SpecialType.System_Int32)));
125arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(mid), _compilation.GetSpecialType(SpecialType.System_Int32)));
126arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(high), _compilation.GetSpecialType(SpecialType.System_Int32)));
127arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(isNegative), _compilation.GetSpecialType(SpecialType.System_Boolean)));
128arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(scale), _compilation.GetSpecialType(SpecialType.System_Byte)));
133Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_Decimal);
148arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(constantValue.DateTimeValue.Ticks), _compilation.GetSpecialType(SpecialType.System_Int64)));
152Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_DateTime);
Lowering\SyntheticBoundNodeFactory.cs (40)
296public NamedTypeSymbol SpecialType(SpecialType st)
653return new BoundIsOperator(this.Syntax, operand, Type(type), c.Kind, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
658Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
659Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
660return Binary(BinaryOperatorKind.LogicalBoolAnd, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
665Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
666Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
667return Binary(BinaryOperatorKind.LogicalBoolOr, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
672return Binary(BinaryOperatorKind.IntEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
677return Binary(BinaryOperatorKind.ObjectEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
682var objectType = SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Object);
688return Binary(BinaryOperatorKind.ObjectNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
693return Binary(BinaryOperatorKind.IntNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
698return Binary(BinaryOperatorKind.IntLessThan, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
703return Binary(BinaryOperatorKind.IntGreaterThanOrEqual, SpecialType(CodeAnalysis.SpecialType.System_Boolean), left, right);
708return Binary(BinaryOperatorKind.IntSubtraction, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
713return Binary(BinaryOperatorKind.IntMultiplication, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
718return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Byte)) { WasCompilerGenerated = true };
723return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
731return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt32)) { WasCompilerGenerated = true };
782case { SpecialType: CodeAnalysis.SpecialType.System_Double }:
785case { SpecialType: CodeAnalysis.SpecialType.System_Single }:
1073Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 });
1135return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
1147return new BoundLiteral(Syntax, stringConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1158return new BoundLiteral(Syntax, charConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Char)) { WasCompilerGenerated = true };
1169return new BoundArrayLength(Syntax, array, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32));
1300return new BoundSizeOfOperator(Syntax, Type(type), Binder.GetConstantSizeOf(type), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
1326SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1336SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1346SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1354SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt64))
1369return new BoundModuleVersionIdString(Syntax, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1378=> new BoundThrowIfModuleCancellationRequested(Syntax, SpecialType(CodeAnalysis.SpecialType.System_Void)) { WasCompilerGenerated = true };
1387SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1399SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1630Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } });
1763TypeSymbol boolType = Compilation.GetSpecialType(CodeAnalysis.SpecialType.System_Boolean);
1777TypeSymbol objectType = SpecialType(CodeAnalysis.SpecialType.System_Object);
1830Debug.Assert(returnType.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
Symbols\Source\SourceDelegateMethodSymbol.cs (7)
59var voidType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax));
61var objectType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax));
62var intPtrType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax));
79if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error &&
80binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
84var iAsyncResultType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax));
85var asyncCallbackType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax));
Symbols\Source\SourceNamedTypeSymbol.cs (15)
939string? name = attributeData.GetConstructorArgument<string>(0, SpecialType.System_String);
1013int length = attributeData.GetConstructorArgument<int>(0, SpecialType.System_Int32);
1033string? methodName = attributeData.GetConstructorArgument<string>(1, SpecialType.System_String);
1052Debug.Assert(this.SpecialType == SpecialType.System_Object || this.DeclaringCompilation.IsAttributeType(this));
1193string? methodName = attribute.CommonConstructorArguments[1].DecodeValue<string>(SpecialType.System_String);
1205int length = attribute.CommonConstructorArguments[0].DecodeValue<int>(SpecialType.System_Int32);
1398string name = attribute.GetConstructorArgument<string>(0, SpecialType.System_String);
1604if ((object)baseType != null && baseType.SpecialType != SpecialType.System_Object)
1709new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message
1710new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true
1715ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))),
1728var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
1788Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr);
1877(type.SpecialType == SpecialType.System_Int32 ||
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (4)
45_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Void, NoLocation.Singleton, diagnostics);
49Construct(Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics));
52_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics);
59TypeWithAnnotations.Create(Binder.GetSpecialType(compilation, SpecialType.System_String, NoLocation.Singleton, diagnostics)))), 0, RefKind.None, "args"));
Utilities\ValueSetFactory.cs (17)
32public static IValueSetFactory? ForSpecialType(SpecialType specialType, bool isNative = false)
36SpecialType.System_Byte => ForByte,
37SpecialType.System_SByte => ForSByte,
38SpecialType.System_Char => ForChar,
39SpecialType.System_Int16 => ForShort,
40SpecialType.System_UInt16 => ForUShort,
41SpecialType.System_Int32 => ForInt,
42SpecialType.System_UInt32 => ForUInt,
43SpecialType.System_Int64 => ForLong,
44SpecialType.System_UInt64 => ForULong,
45SpecialType.System_Boolean => ForBool,
46SpecialType.System_Single => ForFloat,
47SpecialType.System_Double => ForDouble,
48SpecialType.System_String => ForString,
49SpecialType.System_Decimal => ForDecimal,
50SpecialType.System_IntPtr when isNative => ForNint,
51SpecialType.System_UIntPtr when isNative => ForNuint,
Completion\Providers\DefaultArgumentProvider.cs (13)
39SpecialType.System_Boolean => "false",
40SpecialType.System_Char => @"'\\0'",
41SpecialType.System_Byte => "(byte)0",
42SpecialType.System_SByte => "(sbyte)0",
43SpecialType.System_Int16 => "(short)0",
44SpecialType.System_UInt16 => "(ushort)0",
45SpecialType.System_Int32 => "0",
46SpecialType.System_UInt32 => "0U",
47SpecialType.System_Int64 => "0L",
48SpecialType.System_UInt64 => "0UL",
49SpecialType.System_Decimal => "0.0m",
50SpecialType.System_Single => "0.0f",
51SpecialType.System_Double => "0.0",
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (4)
97SpecialType.System_Byte => IsUnsignedBoundary(startValue, endValue, byte.MaxValue),
98SpecialType.System_UInt16 => IsUnsignedBoundary(startValue, endValue, ushort.MaxValue),
99SpecialType.System_UInt32 => IsUnsignedBoundary(startValue, endValue, uint.MaxValue),
100SpecialType.System_UInt64 => IsUnsignedBoundary(startValue, endValue, ulong.MaxValue),
Analysis\FlowAnalysis\AbstractFlowPass.vb (22)
334Case SpecialType.System_Void,
335SpecialType.System_Boolean,
336SpecialType.System_Char,
337SpecialType.System_SByte,
338SpecialType.System_Byte,
339SpecialType.System_Int16,
340SpecialType.System_UInt16,
341SpecialType.System_Int32,
342SpecialType.System_UInt32,
343SpecialType.System_Int64,
344SpecialType.System_UInt64,
345SpecialType.System_Decimal,
346SpecialType.System_Single,
347SpecialType.System_Double,
348SpecialType.System_DateTime,
349SpecialType.System_TypedReference,
350SpecialType.System_ArgIterator,
351SpecialType.System_RuntimeArgumentHandle,
352SpecialType.System_RuntimeFieldHandle,
353SpecialType.System_RuntimeMethodHandle,
354SpecialType.System_RuntimeTypeHandle
830Debug.Assert(node.ValueOpt IsNot Nothing OrElse node.HasErrors OrElse node.Type.SpecialType = SpecialType.System_Void)
Binding\Binder.vb (6)
427Public Function GetSpecialType(typeId As SpecialType, node As SyntaxNodeOrToken, diagBag As BindingDiagnosticBag) As NamedTypeSymbol
432Public Shared Function GetSpecialType(compilation As VisualBasicCompilation, typeId As SpecialType, node As SyntaxNodeOrToken, diagBag As BindingDiagnosticBag) As NamedTypeSymbol
437Public Function GetSpecialType(typeId As SpecialType, node As SyntaxNodeOrToken, diagBag As BindingDiagnosticBag, ByRef reportedAnError As Boolean, suppressUseSiteError As Boolean) As NamedTypeSymbol
441Public Shared Function GetSpecialType(compilation As VisualBasicCompilation, typeId As SpecialType, node As SyntaxNodeOrToken, diagBag As BindingDiagnosticBag, ByRef reportedAnError As Boolean, suppressUseSiteError As Boolean) As NamedTypeSymbol
522If candidateProperty.Type.SpecialType <> SpecialType.System_String OrElse
536If parameterType.OriginalDefinition.SpecialType <> SpecialType.System_Collections_Generic_IEnumerable_T OrElse
Binding\Binder_Expressions.vb (36)
552expressionType = GetSpecialType(SpecialType.System_Object, expression.Syntax, diagnostics)
693If typeSym.IsArrayType AndAlso DirectCast(typeSym, ArrayTypeSymbol).ElementType.SpecialType = SpecialType.System_Void Then
765Return New BoundNameOfOperator(node, argument, ConstantValue.Create(value), GetSpecialType(SpecialType.System_String, node, diagnostics))
778Dim resultType As TypeSymbol = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
803operand = ApplyImplicitConversion(node, GetSpecialType(SpecialType.System_Object, node.Expression, diagnostics), operand, diagnostics)
972resultType = GetSpecialType(SpecialType.System_Nullable_T, expr.Syntax, diagnostics).Construct(resultType)
1258(exprType IsNot Nothing AndAlso exprType.SpecialType = SpecialType.System_Void) Then
1439GetSpecialType(SpecialType.System_Object, expr.Syntax, diagnostics), Nothing)
1539(originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
1540originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IList_T OrElse
1541originalTargetType.SpecialType = SpecialType.System_Collections_Generic_ICollection_T OrElse
1542originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyList_T OrElse
1543originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyCollection_T) Then
1944dominantType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
2011dominantType = If(boundFirstArg.Type, If(boundSecondArg.Type, GetSpecialType(SpecialType.System_Object, node, diagnostics)))
2483MemberLookup.GetTypeForIntrinsicAlias(name) <> SpecialType.None Then
3748GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3765If type.SpecialType = SpecialType.System_Object OrElse type.IsExtensibleInterfaceNoUseSiteDiagnostics() Then
3767Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3786Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3803If type.SpecialType = SpecialType.System_Array Then
3829GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3872Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3895Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3897If specialType <> specialType.None Then
3919Dim int32Type = GetSpecialType(SpecialType.System_Int32, node.ArgumentList, diagnostics)
4130Dim Int32Type = GetSpecialType(SpecialType.System_Int32, node, diagnostics)
4214inferredElementType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
4346Dim int32Type = GetSpecialType(SpecialType.System_Int32, arrayBoundsOpt, diagnostics)
4461Dim specialType As SpecialType = SpecialTypeExtensions.FromRuntimeTypeOfLiteralValue(value)
4464Debug.Assert(specialType <> specialType.None AndAlso
4465specialType <> specialType.System_Byte AndAlso
4466specialType <> specialType.System_SByte)
4600Debug.Assert(dominantType.IsArrayType AndAlso DirectCast(dominantType, ArrayTypeSymbol).Rank = 1 AndAlso DirectCast(dominantType, ArrayTypeSymbol).ElementType.SpecialType = SpecialType.System_Object)
4606dominantType = GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
4611dominantType = GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
Binding\Binder_Invocation.vb (10)
338If target.Type.SpecialType = SpecialType.System_Object OrElse
339target.Type.SpecialType = SpecialType.System_Array Then
2719GetSpecialType(SpecialType.System_Int32, node, diagnostics)).MakeCompilerGenerated()}).AsImmutableOrNull(),
3178literal = New BoundLiteral(syntax, callerInfoValue, GetSpecialType(SpecialType.System_Int32, syntax, ignoreDiagnostics))
3181literal = New BoundLiteral(syntax, callerInfoValue, GetSpecialType(SpecialType.System_String, syntax, ignoreDiagnostics))
3219defaultConstantValue = ConstantValue.Default(SpecialType.System_Int32)
3222If paramNullableUnderlyingTypeOrSelf.GetEnumUnderlyingTypeOrSelf().SpecialType = SpecialType.System_Int32 Then
3225defaultArgumentType = GetSpecialType(SpecialType.System_Int32, syntax, diagnostics)
3228ElseIf defaultSpecialType <> SpecialType.None Then
3249If param.Type.SpecialType = SpecialType.System_Object Then
Binding\Binder_Lambda.vb (20)
61If originalRetTypeDef.SpecialType <> SpecialType.System_Collections_Generic_IEnumerable_T AndAlso
62originalRetTypeDef.SpecialType <> SpecialType.System_Collections_Generic_IEnumerator_T AndAlso
63returnType.SpecialType <> SpecialType.System_Collections_IEnumerable AndAlso
64returnType.SpecialType <> SpecialType.System_Collections_IEnumerator Then
73returnType = GetSpecialType(SpecialType.System_Void, node.SubOrFunctionHeader, diagnostics)
133objectType = GetSpecialType(SpecialType.System_Object, unboundParam.IdentifierSyntax, diagnostics)
172If target.ReturnType.SpecialType <> SpecialType.System_Void AndAlso
174Not ((source.Flags And SourceMemberFlags.Iterator) <> 0 AndAlso (target.ReturnType.SpecialType = SpecialType.System_Collections_IEnumerable OrElse
175target.ReturnType.SpecialType = SpecialType.System_Collections_IEnumerator)) Then
188If origTargetReturnType.SpecialType <> SpecialType.System_Collections_Generic_IEnumerable_T AndAlso
189origTargetReturnType.SpecialType <> SpecialType.System_Collections_Generic_IEnumerator_T Then
205Compilation.GetSpecialType(SpecialType.System_Void), ' No need to report use-site error.
289If source.ReturnType Is Nothing AndAlso target.ReturnType.SpecialType <> SpecialType.System_Void Then
773Dim targetSignature As New UnboundLambda.TargetSignature(ImmutableArray(Of ParameterSymbol).Empty, Compilation.GetSpecialType(SpecialType.System_Void), returnsByRef:=False)
850commonParameterTypes(i) = Compilation.GetSpecialType(SpecialType.System_Object)
863Compilation.GetSpecialType(SpecialType.System_Void),
925lambdaReturnType = GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T, source.Syntax, diagnostics).
926Construct(GetSpecialType(SpecialType.System_Object, source.Syntax, diagnostics))
942lambdaReturnType = GetSpecialType(SpecialType.System_Object, source.Syntax, diagnostics)
997lambdaReturnType = GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T, source.Syntax, diagnostics).Construct(lambdaReturnType)
Binding\Binder_Operators.vb (27)
75Dim booleanType = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
111GetSpecialType(SpecialType.System_Object, targetArgument.Syntax, diagnostics),
134GetSpecialType(SpecialType.System_Object, targetArgument.Syntax, diagnostics),
286Dim intrinsicOperatorType As SpecialType = SpecialType.None
333If intrinsicOperatorType = SpecialType.None Then
372Dim booleanType As TypeSymbol = GetSpecialTypeForBinaryOperator(node, leftType, rightType, SpecialType.System_Boolean,
484Dim rightTargetType As TypeSymbol = GetSpecialTypeForBinaryOperator(node, leftType, rightType, SpecialType.System_Int32,
821stringType = GetSpecialType(SpecialType.System_String, dbNullOperand.Syntax, diagnostics)
839specialType As SpecialType,
912If ofSpecialType <> SpecialType.None Then
1020Dim defaultRightSpecialType As SpecialType
1025defaultRightSpecialType = SpecialType.System_String
1029defaultRightSpecialType = SpecialType.System_Boolean
1049defaultRightSpecialType = SpecialType.System_Int32
1068Dim defaultLeftSpecialType As SpecialType = SpecialType.None
1082defaultLeftSpecialType = SpecialType.System_String
1088defaultLeftSpecialType = SpecialType.System_Int32
1091If defaultLeftSpecialType = SpecialType.None OrElse defaultLeftSpecialType = rightType.SpecialType Then
1122If leftType.SpecialType <> SpecialType.System_String Then
1123rightType = GetSpecialType(SpecialType.System_String, right.Syntax, diagnostics)
1143Dim int32Type = GetSpecialType(SpecialType.System_Int32, node.Operand, diagnostics)
1154Dim intrinsicOperatorType As SpecialType = SpecialType.None
1188If intrinsicOperatorType = SpecialType.None Then
1207If operandType.SpecialType = SpecialType.System_Object Then
Binding\Binder_SelectCase.vb (14)
390Dim booleanType = GetSpecialType(SpecialType.System_Boolean, selectExpression.Syntax, diagnostics)
694Case SpecialType.System_Boolean,
695SpecialType.System_Byte,
696SpecialType.System_UInt16,
697SpecialType.System_UInt32,
698SpecialType.System_UInt64
701Case SpecialType.System_SByte,
702SpecialType.System_Int16,
703SpecialType.System_Int32,
704SpecialType.System_Int64,
705SpecialType.System_Char
708Case SpecialType.System_Single,
709SpecialType.System_Double
712Case SpecialType.System_Decimal
Binding\Binder_Statements.vb (40)
810target.Type.SpecialType <> SpecialType.System_Array AndAlso
811target.Type.SpecialType <> SpecialType.System_Object Then
1365If hasExplicitType AndAlso Not (symbol.IsConst AndAlso type.SpecialType = SpecialType.System_Object) Then
2207Dim int32 As NamedTypeSymbol = GetSpecialType(SpecialType.System_Int32, midExpression, diagnostics)
2219Dim stringType As NamedTypeSymbol = GetSpecialType(SpecialType.System_String, midExpression, diagnostics)
2264Compilation.GetSpecialType(SpecialType.System_Void),
2451Dim container = If(exprSymbol IsNot Nothing, exprSymbol.ContainingSymbol, Compilation.GetSpecialType(SpecialType.System_Object))
2751GetSpecialType(SpecialType.System_Void, conditionalAccess.Syntax, diagnostics))
3165Me.GetSpecialType(SpecialType.System_Int32, forStatement, diagnostics))
3191Dim integerType = GetSpecialType(SpecialType.System_Int32, node, diagnostics)
3192Dim booleanType = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
3488Dim idisposableType = Compilation.GetSpecialType(SpecialType.System_IDisposable)
3504Debug.Assert(enumeratorType.SpecialType = SpecialType.System_Collections_IEnumerator)
3749Dim interfaceSpecialType As SpecialType = SpecialType.None
3771Dim genericIEnumerable = GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T, collectionSyntax, ienumerableUseSiteDiagnostics)
3806interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T
3811Dim ienumerable = GetSpecialType(SpecialType.System_Collections_IEnumerable, collectionSyntax, ienumerableUseSiteDiagnostics)
3821interfaceSpecialType = SpecialType.System_Collections_IEnumerable
3872If interfaceSpecialType <> SpecialType.None Then
3879If interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T Then
3939If interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T Then
3983elementType = GetSpecialType(SpecialType.System_Char, collectionSyntax, diagnostics)
3989Dim idisposable = GetSpecialType(SpecialType.System_IDisposable, collectionSyntax, diagnostics)
4003getEnumeratorReturnType.SpecialType = SpecialType.System_Collections_IEnumerator Then
4165DirectCast(boundMoveNextCall, BoundCall).Method.OriginalDefinition.ReturnType.SpecialType <> SpecialType.System_Boolean Then
4355Dim valueTypeSymbol = interfaceType.ContainingAssembly.GetSpecialType(SpecialType.System_ValueType)
4446Dim iDisposable = GetSpecialType(SpecialType.System_IDisposable,
4952Dim boolSymbol As NamedTypeSymbol = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
4979Return Compilation.GetSpecialType(SpecialType.System_Void)
4983Return Compilation.GetSpecialType(SpecialType.System_Void)
5017If retType.SpecialType = SpecialType.System_Void Then
5023If(isAsync AndAlso Not methodReturnType.SpecialType = SpecialType.System_Void, ERRID.ERR_ReturnFromNonGenericTaskAsync, ERRID.ERR_ReturnFromNonFunction)))
5107Dim returnSpecialType As SpecialType = If(returnNamedType IsNot Nothing, returnNamedType.SpecialType, Nothing)
5109If returnSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
5110returnSpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
5115If returnSpecialType = SpecialType.System_Collections_IEnumerable OrElse
5116returnSpecialType = SpecialType.System_Collections_IEnumerator Then
5118Return GetSpecialType(SpecialType.System_Object, node, diagnostics)
5236GetSpecialType(SpecialType.System_Int32, node.ErrorNumber, diagnostics),
Binding\Binder_Utils.vb (34)
295Dim nullableType As NamedTypeSymbol = DirectCast(GetSpecialType(SpecialType.System_Nullable_T, syntax, diagBag), NamedTypeSymbol)
673Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(identifier.GetTypeCharacter(), typeCharacterString)
695Return GetSpecialType(SpecialType.System_Object, identifier, diagBag)
699Public Shared Function GetSpecialTypeForTypeCharacter(typeChar As TypeCharacter, ByRef typeCharacterString As String) As SpecialType
700Dim specialType As SpecialType = SpecialType.None
704specialType = SpecialType.System_Decimal
707specialType = SpecialType.System_Decimal
710specialType = SpecialType.System_Double
713specialType = SpecialType.System_Double
716specialType = SpecialType.System_Int32
719specialType = SpecialType.System_Int32
722specialType = SpecialType.System_Int64
725specialType = SpecialType.System_Int64
728specialType = SpecialType.System_Int16
731specialType = SpecialType.System_Single
734specialType = SpecialType.System_Single
737specialType = SpecialType.System_String
740specialType = SpecialType.System_UInt32
743specialType = SpecialType.System_UInt64
746specialType = SpecialType.System_UInt16
1374Case SpecialType.System_Boolean,
1375SpecialType.System_Byte,
1376SpecialType.System_SByte,
1377SpecialType.System_Int16,
1378SpecialType.System_UInt16,
1379SpecialType.System_Int32,
1380SpecialType.System_UInt32,
1381SpecialType.System_Int64,
1382SpecialType.System_UInt64,
1383SpecialType.System_Single,
1384SpecialType.System_Double,
1385SpecialType.System_Char
1408If(operandType, GetSpecialType(SpecialType.System_Object, operand.Syntax, diagnostics)),
Binding\Binder_XmlLiterals.vb (7)
292Dim prefixesType = CreateArrayType(GetSpecialType(SpecialType.System_String, syntax, diagnostics))
647If receiverType.SpecialType = SpecialType.System_Object Then
674memberAccess = BadExpression(syntax, ImmutableArray.Create(receiver, name), Compilation.GetSpecialType(SpecialType.System_String))
697If receiverType.SpecialType = SpecialType.System_Object Then
797Return BadExpression(syntax, Compilation.GetSpecialType(SpecialType.System_String))
903Dim result = BadExpression(syntax, Compilation.GetSpecialType(SpecialType.System_String))
1057Dim result = New BoundLiteral(syntax, ConstantValue.Create(str), GetSpecialType(SpecialType.System_String, syntax, diagnostics), hasErrors:=hasErrors)
Emit\PEModuleBuilder.vb (4)
592Friend NotOverridable Overrides Function GetSpecialType(specialType As SpecialType, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.INamedTypeReference
599Private Function GetUntranslatedSpecialType(specialType As SpecialType, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As NamedTypeSymbol
622Return namedType.SpecialType = CType(platformType, SpecialType)
757Return New SynthesizedPrivateImplementationDetailsSharedConstructor(SourceModule, GetPrivateImplClass(syntaxOpt, diagnostics), GetUntranslatedSpecialType(SpecialType.System_Void, syntaxOpt, diagnostics)).GetCciAdapter()
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Spilling.vb (24)
333Me.F.SpecialType(SpecialType.System_Object)))
345Me.F.SpecialType(SpecialType.System_Object)))
356Me.F.SpecialType(SpecialType.System_Object)))
479Case SpecialType.System_Void,
480SpecialType.System_Boolean,
481SpecialType.System_Char,
482SpecialType.System_SByte,
483SpecialType.System_Byte,
484SpecialType.System_Int16,
485SpecialType.System_UInt16,
486SpecialType.System_Int32,
487SpecialType.System_UInt32,
488SpecialType.System_Int64,
489SpecialType.System_UInt64,
490SpecialType.System_Decimal,
491SpecialType.System_Single,
492SpecialType.System_Double,
493SpecialType.System_IntPtr,
494SpecialType.System_UIntPtr,
495SpecialType.System_TypedReference,
496SpecialType.System_ArgIterator,
497SpecialType.System_RuntimeArgumentHandle
500Case SpecialType.System_Object,
501SpecialType.System_String
Lowering\IteratorRewriter\IteratorRewriter.vb (16)
37Me._elementType = method.ContainingAssembly.GetSpecialType(SpecialType.System_Object)
63Dim isEnumerable As Boolean = retSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
64retSpecialType = SpecialType.System_Collections_IEnumerable
68elementType = method.ContainingAssembly.GetSpecialType(SpecialType.System_Object)
103EnsureSpecialType(SpecialType.System_Object, bag)
104EnsureSpecialType(SpecialType.System_Boolean, bag)
105EnsureSpecialType(SpecialType.System_Int32, bag)
106EnsureSpecialType(SpecialType.System_IDisposable, bag)
110EnsureSpecialType(SpecialType.System_Collections_IEnumerator, bag)
116EnsureSpecialType(SpecialType.System_Collections_Generic_IEnumerator_T, bag)
120EnsureSpecialType(SpecialType.System_Collections_IEnumerable, bag)
122EnsureSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T, bag)
139Me.StateField = Me.F.StateMachineField(Me.F.SpecialType(SpecialType.System_Int32), Me.Method, GeneratedNames.MakeStateMachineStateFieldName(), Accessibility.Public)
146F.StateMachineField(F.SpecialType(SpecialType.System_Int32), Me.Method, GeneratedNames.MakeIteratorInitialThreadIdName(), Accessibility.Public),
181Dim getEnumeratorGeneric = Me.OpenMethodImplementation(F.SpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(_elementType),
275Me.OpenPropertyImplementation(F.SpecialType(SpecialType.System_Collections_Generic_IEnumerator_T).Construct(_elementType),
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (13)
70Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
110Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
199Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
266Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
324Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
341Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
398Me.GetSpecialType(SpecialType.System_Void))
457Me.GetSpecialType(SpecialType.System_Void))
531Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(memberAccess), Nothing, Me.GetSpecialType(SpecialType.System_Void))
536Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(memberAccess), Nothing, Me.GetSpecialType(SpecialType.System_Void))
610Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(invocation), Nothing, Me.GetSpecialType(SpecialType.System_Void))
615Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(invocation), Nothing, Me.GetSpecialType(SpecialType.System_Void))
948Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
Preprocessor\CConst.vb (39)
24Public MustOverride ReadOnly Property SpecialType As SpecialType
41Case SpecialType.System_Boolean
43Case SpecialType.System_Byte
45Case SpecialType.System_Char
47Case SpecialType.System_DateTime
49Case SpecialType.System_Decimal
51Case SpecialType.System_Double
53Case SpecialType.System_Int16
55Case SpecialType.System_Int32
57Case SpecialType.System_Int64
59Case SpecialType.System_SByte
61Case SpecialType.System_Single
63Case SpecialType.System_String
65Case SpecialType.System_UInt16
67Case SpecialType.System_UInt32
69Case SpecialType.System_UInt64
77Return New CConst(Of Object)(Nothing, SpecialType.System_Object)
81Return New CConst(Of Boolean)(value, SpecialType.System_Boolean)
85Return New CConst(Of Byte)(value, SpecialType.System_Byte)
89Return New CConst(Of SByte)(value, SpecialType.System_SByte)
93Return New CConst(Of Char)(value, SpecialType.System_Char)
97Return New CConst(Of Short)(value, SpecialType.System_Int16)
101Return New CConst(Of UShort)(value, SpecialType.System_UInt16)
105Return New CConst(Of Integer)(value, SpecialType.System_Int32)
109Return New CConst(Of UInteger)(value, SpecialType.System_UInt32)
113Return New CConst(Of Long)(value, SpecialType.System_Int64)
117Return New CConst(Of ULong)(value, SpecialType.System_UInt64)
121Return New CConst(Of Decimal)(value, SpecialType.System_Decimal)
125Return New CConst(Of String)(value, SpecialType.System_String)
129Return New CConst(Of Single)(value, SpecialType.System_Single)
133Return New CConst(Of Double)(value, SpecialType.System_Double)
137Return New CConst(Of Date)(value, SpecialType.System_DateTime)
142Return SpecialType = SpecialType.None
180Private ReadOnly _specialType As SpecialType
183Friend Sub New(value As T, specialType As SpecialType)
188Private Sub New(value As T, specialType As SpecialType, id As ERRID)
195Public Overrides ReadOnly Property SpecialType As SpecialType
229Public Overrides ReadOnly Property SpecialType As SpecialType
231Return SpecialType.None
Preprocessor\ExpressionEvaluator.vb (190)
25Const _____Byte = CType(SpecialType.System_Byte, Byte)
26Const ____SByte = CType(SpecialType.System_SByte, Byte)
27Const ____Int16 = CType(SpecialType.System_Int16, Byte)
28Const ___UInt16 = CType(SpecialType.System_UInt16, Byte)
29Const ____Int32 = CType(SpecialType.System_Int32, Byte)
30Const ___UInt32 = CType(SpecialType.System_UInt32, Byte)
31Const ____Int64 = CType(SpecialType.System_Int64, Byte)
32Const ___UInt64 = CType(SpecialType.System_UInt64, Byte)
33Const ___Single = CType(SpecialType.System_Single, Byte)
34Const ___Double = CType(SpecialType.System_Double, Byte)
35Const __Decimal = CType(SpecialType.System_Decimal, Byte)
36Const _DateTime = CType(SpecialType.System_DateTime, Byte)
37Const _____Char = CType(SpecialType.System_Char, Byte)
38Const __Boolean = CType(SpecialType.System_Boolean, Byte)
39Const ___String = CType(SpecialType.System_String, Byte)
40Const ___Object = CType(SpecialType.System_Object, Byte)
73Private Shared Function TypeCodeToDominantTypeIndex(specialType As SpecialType) As Integer
75Case SpecialType.System_Byte
77Case SpecialType.System_SByte
79Case SpecialType.System_Int16
81Case SpecialType.System_UInt16
83Case SpecialType.System_Int32
85Case SpecialType.System_UInt32
87Case SpecialType.System_Int64
89Case SpecialType.System_UInt64
91Case SpecialType.System_Single
93Case SpecialType.System_Double
95Case SpecialType.System_Decimal
97Case SpecialType.System_DateTime
99Case SpecialType.System_Char
101Case SpecialType.System_Boolean
103Case SpecialType.System_String
105Case SpecialType.System_Object
325Private Shared Function AsTypeCharacter(specialType As SpecialType) As TypeCharacter
327Case SpecialType.System_Int32
330Case SpecialType.System_Int64
333Case SpecialType.System_Decimal
336Case SpecialType.System_Single
339Case SpecialType.System_Double
342Case SpecialType.System_String
350Private Shared Function GetSpecialType(predefinedType As PredefinedTypeSyntax) As SpecialType
354Return SpecialType.System_Int16
357Return SpecialType.System_UInt16
360Return SpecialType.System_Int32
363Return SpecialType.System_UInt32
366Return SpecialType.System_Int64
369Return SpecialType.System_UInt64
372Return SpecialType.System_Decimal
375Return SpecialType.System_Single
378Return SpecialType.System_Double
381Return SpecialType.System_SByte
384Return SpecialType.System_Byte
387Return SpecialType.System_Boolean
390Return SpecialType.System_Char
393Return SpecialType.System_DateTime
396Return SpecialType.System_String
400Return SpecialType.System_Object
417If specialType <> SpecialType.System_Object AndAlso specialType <> SpecialType.System_String Then
421If value.SpecialType = SpecialType.System_Object OrElse
422value.SpecialType = SpecialType.System_String Then
428If specialType = SpecialType.System_Double OrElse specialType = SpecialType.System_Single Then
448If val.SpecialType = SpecialType.System_Object OrElse
449val.SpecialType = SpecialType.System_String Then
455If specialType = SpecialType.System_Double OrElse specialType = SpecialType.System_Single Then
483Dim specialType As SpecialType
487specialType = SpecialType.System_Boolean
490specialType = SpecialType.System_DateTime
493specialType = SpecialType.System_Double
496specialType = SpecialType.System_SByte
499specialType = SpecialType.System_Byte
502specialType = SpecialType.System_Char
505specialType = SpecialType.System_Int16
508specialType = SpecialType.System_UInt16
511specialType = SpecialType.System_Int32
514specialType = SpecialType.System_UInt32
517specialType = SpecialType.System_Int64
520specialType = SpecialType.System_UInt64
523specialType = SpecialType.System_Single
526specialType = SpecialType.System_String
529specialType = SpecialType.System_Decimal
573If Not IsNothing(whenFalse) AndAlso whenFalse.SpecialType <> SpecialType.System_Object Then
577If whenTrue.SpecialType <> SpecialType.System_Object Then
581Dim dominantType As SpecialType = CType(s_dominantType(TypeCodeToDominantTypeIndex(whenTrue.SpecialType), TypeCodeToDominantTypeIndex(whenFalse.SpecialType)), SpecialType)
611If specialType = SpecialType.System_Boolean Then
620Case SpecialType.System_Char
621Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, SpecialType.System_Char.GetDisplayName(), SpecialType.System_Boolean.GetDisplayName())
622Case SpecialType.System_DateTime
623Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, SpecialType.System_DateTime.GetDisplayName(), SpecialType.System_Boolean.GetDisplayName())
624Case SpecialType.System_Object
630Case SpecialType.System_String
631Return ReportSemanticError(ERRID.ERR_RequiredConstConversion2, expr, SpecialType.System_String.GetDisplayName(), SpecialType.System_Boolean.GetDisplayName())
633Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, specialType, SpecialType.System_Boolean.GetDisplayName())
637Private Shared Function ConvertToNumeric(value As CConst, toSpecialType As SpecialType, expr As ExpressionSyntax) As CConst
659Case SpecialType.System_Boolean
663numericVal = NarrowIntegralResult(numericVal, SpecialType.System_Int64, toSpecialType, False)
667Case SpecialType.System_Char
668Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, SpecialType.System_Char.GetDisplayName(), toSpecialType.GetDisplayName())
670Case SpecialType.System_DateTime
671Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, SpecialType.System_DateTime.GetDisplayName(), toSpecialType.GetDisplayName())
673Case SpecialType.System_Object
676Case SpecialType.System_String
677Return ReportSemanticError(ERRID.ERR_RequiredConstConversion2, expr, SpecialType.System_String.GetDisplayName(), toSpecialType.GetDisplayName())
684Private Shared Function ConvertNumericToNumeric(value As CConst, toSpecialType As SpecialType, expr As ExpressionSyntax) As CConst
695Private Shared Function Convert(value As CConst, toSpecialType As SpecialType, expr As ExpressionSyntax) As CConst
710Case SpecialType.System_Boolean
712Case SpecialType.System_Char
714Case SpecialType.System_DateTime
716Case SpecialType.System_Object
718Case SpecialType.System_String
731If fromSpecialType = SpecialType.System_Char Then
740Case SpecialType.System_Boolean
741Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_Char.GetDisplayName())
743Case SpecialType.System_DateTime
744Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_Char.GetDisplayName())
746Case SpecialType.System_Object
753Case SpecialType.System_String
759Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_Char.GetDisplayName())
769If fromSpecialType = SpecialType.System_DateTime Then
774Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_DateTime.GetDisplayName())
778Case SpecialType.System_Boolean
779Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_DateTime.GetDisplayName())
781Case SpecialType.System_Char
782Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_DateTime.GetDisplayName())
784Case SpecialType.System_String
787Case SpecialType.System_Object
795Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, fromSpecialType, SpecialType.System_DateTime.GetDisplayName())
805If specialType = SpecialType.System_String Then
814Case SpecialType.System_Boolean
817Case SpecialType.System_Char
821Case SpecialType.System_DateTime
824Case SpecialType.System_Object
832Return ReportSemanticError(ERRID.ERR_TypeMismatch2, expr, specialType, SpecialType.System_String.GetDisplayName())
845Return ReportSemanticError(ERRID.ERR_RequiredConstConversion2, expr, value.SpecialType.GetDisplayName(), SpecialType.System_Object.GetDisplayName())
852If specialType = SpecialType.None Then
856If specialType = SpecialType.System_String OrElse
857(specialType = SpecialType.System_Object AndAlso Not IsNothing(val)) OrElse
858specialType = SpecialType.System_Char OrElse specialType = SpecialType.System_DateTime Then
869Case SpecialType.System_Boolean
871Case SpecialType.System_Byte
873Case SpecialType.System_Decimal
875Case SpecialType.System_Double
877Case SpecialType.System_Int16
879Case SpecialType.System_Int32
881Case SpecialType.System_Int64
883Case SpecialType.System_SByte
885Case SpecialType.System_Single
887Case SpecialType.System_UInt16
889Case SpecialType.System_UInt32
891Case SpecialType.System_UInt64
898If specialType = SpecialType.System_Boolean Then
908Case SpecialType.System_Boolean
910Case SpecialType.System_Byte
912Case SpecialType.System_Decimal
914Case SpecialType.System_Double
916Case SpecialType.System_Int16
918Case SpecialType.System_Int32
920Case SpecialType.System_Int64
922Case SpecialType.System_SByte
924Case SpecialType.System_Single
926Case SpecialType.System_UInt16
928Case SpecialType.System_UInt32
930Case SpecialType.System_UInt64
944Return val.SpecialType = SpecialType.System_Object AndAlso val.ValueAsObject Is Nothing
956Dim OperandType As SpecialType = SpecialType.None
1000Right = ConvertToNumeric(Right, SpecialType.System_Int32, expr.Right)
1006Right = ConvertToNumeric(Right, SpecialType.System_Int32, expr.Right)
1023OperandType = SpecialType.System_String
1029OperandType = SpecialType.System_Int32
1045OperandType = SpecialType.System_String
1060If ResultType = SpecialType.None Then
1077If ResultType = SpecialType.System_String Then
1089ResultType = SpecialType.System_Boolean
1103resultType As SpecialType,
1112If left.SpecialType.IsIntegralType() OrElse left.SpecialType = SpecialType.System_Char OrElse left.SpecialType = SpecialType.System_DateTime Then
1116If resultType = SpecialType.System_Boolean Then
1282If resultType = SpecialType.System_Boolean Then
1407ElseIf left.SpecialType = SpecialType.System_Decimal Then
1411If resultType = SpecialType.System_Boolean Then
1491ElseIf left.SpecialType = SpecialType.System_String Then
1540ElseIf left.SpecialType = SpecialType.System_Boolean Then
Preprocessor\OperatorResolution.vb (39)
28Private Function TypeCodeToIndex(specialType As SpecialType) As Integer
30Case SpecialType.None
32Case SpecialType.System_Boolean
34Case SpecialType.System_SByte
36Case SpecialType.System_Byte
38Case SpecialType.System_Int16
40Case SpecialType.System_UInt16
42Case SpecialType.System_Int32
44Case SpecialType.System_UInt32
46Case SpecialType.System_Int64
48Case SpecialType.System_UInt64
50Case SpecialType.System_Decimal
52Case SpecialType.System_Single
54Case SpecialType.System_Double
56Case SpecialType.System_DateTime
58Case SpecialType.System_Char
60Case SpecialType.System_String
62Case SpecialType.System_Object
78Const t_r4 As Byte = CType(SpecialType.System_Single, Byte)
79Const t_r8 As Byte = CType(SpecialType.System_Double, Byte)
80Const t_dec As Byte = CType(SpecialType.System_Decimal, Byte)
81Const t_str As Byte = CType(SpecialType.System_String, Byte)
83Const t_bad As Byte = CType(SpecialType.None, Byte)
84Const t_i1 As Byte = CType(SpecialType.System_SByte, Byte)
85Const t_i2 As Byte = CType(SpecialType.System_Int16, Byte)
86Const t_i4 As Byte = CType(SpecialType.System_Int32, Byte)
87Const t_i8 As Byte = CType(SpecialType.System_Int64, Byte)
88Const t_ui1 As Byte = CType(SpecialType.System_Byte, Byte)
89Const t_ui2 As Byte = CType(SpecialType.System_UInt16, Byte)
90Const t_ui4 As Byte = CType(SpecialType.System_UInt32, Byte)
91Const t_ui8 As Byte = CType(SpecialType.System_UInt64, Byte)
93Const t_ref As Byte = CType(SpecialType.System_Object, Byte)
94Const t_bool As Byte = CType(SpecialType.System_Boolean, Byte)
95Const t_date As Byte = CType(SpecialType.System_DateTime, Byte)
96Const t_char As Byte = CType(SpecialType.System_Char, Byte)
298Friend Function LookupInOperatorTables(opcode As SyntaxKind, left As SpecialType, right As SpecialType) As SpecialType
349Return CType(s_table(whichTable, TypeCodeToIndex(left), TypeCodeToIndex(right)), SpecialType)
Semantics\Operators.vb (99)
429ElseIf If(containingType.SpecialType = SpecialType.System_Nullable_T,
470If containingType.SpecialType = SpecialType.System_Nullable_T Then
501<Out()> ByRef intrinsicOperatorType As SpecialType,
508intrinsicOperatorType = SpecialType.None
529If sourceType.SpecialType <> SpecialType.System_Object AndAlso
559If intrinsicOperatorType <> SpecialType.None Then
576operandSpecialType As SpecialType
577) As SpecialType
579Dim intrinsicOperatorType As SpecialType
589Case SpecialType.System_Boolean,
590SpecialType.System_SByte,
591SpecialType.System_Byte,
592SpecialType.System_Int16,
593SpecialType.System_UInt16,
594SpecialType.System_Int32,
595SpecialType.System_UInt32,
596SpecialType.System_Int64,
597SpecialType.System_UInt64,
598SpecialType.System_Object
602Case SpecialType.System_Decimal,
603SpecialType.System_Single,
604SpecialType.System_Double,
605SpecialType.System_String
607intrinsicOperatorType = SpecialType.System_Int64
610intrinsicOperatorType = SpecialType.None
620Case SpecialType.System_Boolean
621intrinsicOperatorType = SpecialType.System_Int16
623Case SpecialType.System_SByte,
624SpecialType.System_Byte,
625SpecialType.System_Int16,
626SpecialType.System_UInt16,
627SpecialType.System_Int32,
628SpecialType.System_UInt32,
629SpecialType.System_Int64,
630SpecialType.System_UInt64,
631SpecialType.System_Decimal,
632SpecialType.System_Single,
633SpecialType.System_Double,
634SpecialType.System_Object
638Case SpecialType.System_String
639intrinsicOperatorType = SpecialType.System_Double
642intrinsicOperatorType = SpecialType.None
652Case SpecialType.System_Boolean,
653SpecialType.System_Byte
655intrinsicOperatorType = SpecialType.System_Int16
657Case SpecialType.System_SByte,
658SpecialType.System_Int16,
659SpecialType.System_Int32,
660SpecialType.System_Int64,
661SpecialType.System_Decimal,
662SpecialType.System_Single,
663SpecialType.System_Double,
664SpecialType.System_Object
668Case SpecialType.System_UInt16
669intrinsicOperatorType = SpecialType.System_Int32
671Case SpecialType.System_UInt32
672intrinsicOperatorType = SpecialType.System_Int64
674Case SpecialType.System_UInt64
675intrinsicOperatorType = SpecialType.System_Decimal
677Case SpecialType.System_String
678intrinsicOperatorType = SpecialType.System_Double
681intrinsicOperatorType = SpecialType.None
858<Out()> ByRef intrinsicOperatorType As SpecialType,
866intrinsicOperatorType = SpecialType.None
903intrinsicOperatorType = SpecialType.System_Object
929intrinsicOperatorType = SpecialType.System_Object
957If leftSpecialType = SpecialType.None AndAlso leftEnumUnderlying.IsCharSZArray() Then
958leftSpecialType = SpecialType.System_String
961If rightSpecialType = SpecialType.None AndAlso rightEnumUnderlying.IsCharSZArray() Then
962rightSpecialType = SpecialType.System_String
967If intrinsicOperatorType <> SpecialType.None Then
975intrinsicOperatorType <> SpecialType.None AndAlso
976intrinsicOperatorType <> SpecialType.System_String AndAlso
977intrinsicOperatorType <> SpecialType.System_Object AndAlso
992If (leftEnumUnderlying.SpecialType <> SpecialType.System_Object AndAlso
995(rightEnumUnderlying.SpecialType <> SpecialType.System_Object AndAlso
1637left As SpecialType,
1638right As SpecialType
1639) As SpecialType
1645Return SpecialType.None
1697Return CType(BinaryOperatorTables.Table(tableKind, leftIndex.Value, rightIndex.Value), SpecialType)
1721Const tErr As SByte = SpecialType.None
1722Const tObj As SByte = SpecialType.System_Object
1723Const tStr As SByte = SpecialType.System_String
1724Const tDbl As SByte = SpecialType.System_Double
1725Const tSBy As SByte = SpecialType.System_SByte
1726Const tShr As SByte = SpecialType.System_Int16
1727Const tInt As SByte = SpecialType.System_Int32
1728Const tLng As SByte = SpecialType.System_Int64
1729Const tDec As SByte = SpecialType.System_Decimal
1730Const tSng As SByte = SpecialType.System_Single
1731Const tByt As SByte = SpecialType.System_Byte
1732Const tUSh As SByte = SpecialType.System_UInt16
1733Const tUIn As SByte = SpecialType.System_UInt32
1734Const tULn As SByte = SpecialType.System_UInt64
1735Const tBoo As SByte = SpecialType.System_Boolean
1736Const tChr As SByte = SpecialType.System_Char
1737Const tDat As SByte = SpecialType.System_DateTime
3163Dim nullableOfT As NamedTypeSymbol = opSet(0).ContainingAssembly.GetSpecialType(SpecialType.System_Nullable_T)
Symbols\Metadata\PE\PENamedTypeSymbol.vb (37)
1025Dim baseCorTypeId As SpecialType = base.SpecialType
1027If baseCorTypeId = SpecialType.System_Enum Then
1030ElseIf baseCorTypeId = SpecialType.System_MulticastDelegate OrElse
1031(baseCorTypeId = SpecialType.System_Delegate AndAlso Me.SpecialType <> SpecialType.System_MulticastDelegate) Then
1034ElseIf (baseCorTypeId = SpecialType.System_ValueType AndAlso
1035Me.SpecialType <> SpecialType.System_Enum) Then
1155Case SpecialType.System_Void,
1156SpecialType.System_Boolean,
1157SpecialType.System_Char,
1158SpecialType.System_Byte,
1159SpecialType.System_SByte,
1160SpecialType.System_Int16,
1161SpecialType.System_UInt16,
1162SpecialType.System_Int32,
1163SpecialType.System_UInt32,
1164SpecialType.System_Int64,
1165SpecialType.System_UInt64,
1166SpecialType.System_Single,
1167SpecialType.System_Double,
1168SpecialType.System_Decimal,
1169SpecialType.System_IntPtr,
1170SpecialType.System_UIntPtr,
1171SpecialType.System_DateTime,
1172SpecialType.System_TypedReference,
1173SpecialType.System_ArgIterator,
1174SpecialType.System_RuntimeArgumentHandle,
1175SpecialType.System_RuntimeFieldHandle,
1176SpecialType.System_RuntimeMethodHandle,
1177SpecialType.System_RuntimeTypeHandle
1330specialtype <> SpecialType.System_Enum AndAlso specialtype <> SpecialType.System_MulticastDelegate Then
1333If base IsNot Nothing AndAlso base.SpecialType = SpecialType.None AndAlso base.ContainingAssembly?.IsMissing Then
1340Case SpecialType.System_Enum,
1341SpecialType.System_Delegate,
1342SpecialType.System_MulticastDelegate,
1343SpecialType.System_ValueType
Symbols\Source\SourceDelegateMethodSymbol.vb (8)
81Dim voidType = binder.GetSpecialType(SpecialType.System_Void, syntax, diagnostics)
82Dim iAsyncResultType = binder.GetSpecialType(SpecialType.System_IAsyncResult, syntax, diagnostics)
83Dim objectType = binder.GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
84Dim intPtrType = binder.GetSpecialType(SpecialType.System_IntPtr, syntax, diagnostics)
85Dim asyncCallbackType = binder.GetSpecialType(SpecialType.System_AsyncCallback, syntax, diagnostics)
123Return binder.GetSpecialType(SpecialType.System_Void, syntax, diagnostics)
258If(returnType.SpecialType = SpecialType.System_Void, SourceMemberFlags.MethodIsSub, Nothing),
331If(invoke.ReturnType.SpecialType = SpecialType.System_Void, SourceMemberFlags.MethodIsSub, Nothing),
Symbols\Source\SourceNamedTypeSymbol.vb (20)
1255Private Function IsRestrictedBaseClass(type As SpecialType) As Boolean
1257Case SpecialType.System_Array,
1258SpecialType.System_Delegate,
1259SpecialType.System_MulticastDelegate,
1260SpecialType.System_Enum,
1261SpecialType.System_ValueType
1381ReportUseSiteInfoForBaseType(Me.DeclaringCompilation.GetSpecialType(SpecialType.System_Object), declaredBase, diagnostics)
1385declaredOrDefaultBase = GetSpecialType(SpecialType.System_Object)
1391declaredOrDefaultBase = GetSpecialType(SpecialType.System_Enum)
1394declaredOrDefaultBase = GetSpecialType(SpecialType.System_ValueType)
1397declaredOrDefaultBase = GetSpecialType(SpecialType.System_MulticastDelegate)
1400declaredOrDefaultBase = GetSpecialType(SpecialType.System_Object)
1420Private Function GetSpecialType(type As SpecialType) As NamedTypeSymbol
1510Return GetSpecialType(SpecialType.System_Enum)
1513Return GetSpecialType(SpecialType.System_MulticastDelegate)
2093Dim conditionalSymbol As String = attrdata.GetConstructorArgument(Of String)(0, SpecialType.System_String)
2534Dim stringType = GetSpecialType(SpecialType.System_String)
2556New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId))))
2562New TypedConstant(GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Enum, CInt(ClassInterfaceType.None)))))
2583New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, eventInterfaceName))))
Symbols\SpecialTypeExtensions.vb (169)
10Public Function IsFloatingType(this As SpecialType) As Boolean
12Case SpecialType.System_Single,
13SpecialType.System_Double
21Public Function IsIntrinsicType(this As SpecialType) As Boolean
22Return this = SpecialType.System_String OrElse this.IsIntrinsicValueType()
26Public Function IsIntrinsicValueType(this As SpecialType) As Boolean
28Case SpecialType.System_Boolean,
29SpecialType.System_Byte,
30SpecialType.System_SByte,
31SpecialType.System_Int16,
32SpecialType.System_UInt16,
33SpecialType.System_Int32,
34SpecialType.System_UInt32,
35SpecialType.System_Int64,
36SpecialType.System_UInt64,
37SpecialType.System_Single,
38SpecialType.System_Double,
39SpecialType.System_Decimal,
40SpecialType.System_DateTime,
41SpecialType.System_Char
49Public Function IsPrimitiveType(this As SpecialType) As Boolean
51Case SpecialType.System_Boolean,
52SpecialType.System_Byte,
53SpecialType.System_Char,
54SpecialType.System_Double,
55SpecialType.System_Int16,
56SpecialType.System_Int32,
57SpecialType.System_Int64,
58SpecialType.System_UInt16,
59SpecialType.System_UInt32,
60SpecialType.System_UInt64,
61SpecialType.System_IntPtr,
62SpecialType.System_UIntPtr,
63SpecialType.System_SByte,
64SpecialType.System_Single
72Public Function IsStrictSupertypeOfConcreteDelegate(this As SpecialType) As Boolean
74Case SpecialType.System_Object,
75SpecialType.System_Delegate,
76SpecialType.System_MulticastDelegate
84Public Function IsRestrictedType(this As SpecialType) As Boolean
86Case SpecialType.System_TypedReference,
87SpecialType.System_ArgIterator,
88SpecialType.System_RuntimeArgumentHandle
96Public Function IsValidTypeForAttributeArgument(this As SpecialType) As Boolean
98Case SpecialType.System_Boolean,
99SpecialType.System_Byte,
100SpecialType.System_SByte,
101SpecialType.System_Int16,
102SpecialType.System_UInt16,
103SpecialType.System_Int32,
104SpecialType.System_UInt32,
105SpecialType.System_Int64,
106SpecialType.System_UInt64,
107SpecialType.System_Single,
108SpecialType.System_Double,
109SpecialType.System_Char,
110SpecialType.System_Object,
111SpecialType.System_String
119Public Function IsValidTypeForSwitchTable(this As SpecialType) As Boolean
121Case SpecialType.System_Byte,
122SpecialType.System_SByte,
123SpecialType.System_Int16,
124SpecialType.System_UInt16,
125SpecialType.System_Int32,
126SpecialType.System_UInt32,
127SpecialType.System_Int64,
128SpecialType.System_UInt64,
129SpecialType.System_Char,
130SpecialType.System_Boolean,
131SpecialType.System_String
139Public Function TypeToIndex(type As SpecialType) As Integer?
143Case SpecialType.System_Object
145Case SpecialType.System_String
147Case SpecialType.System_Boolean
149Case SpecialType.System_Char
151Case SpecialType.System_SByte
153Case SpecialType.System_Int16
155Case SpecialType.System_Int32
157Case SpecialType.System_Int64
159Case SpecialType.System_Byte
161Case SpecialType.System_UInt16
163Case SpecialType.System_UInt32
165Case SpecialType.System_UInt64
167Case SpecialType.System_Single
169Case SpecialType.System_Double
171Case SpecialType.System_Decimal
173Case SpecialType.System_DateTime
184Public Function GetNativeCompilerVType(this As SpecialType) As String
186Case SpecialType.System_Void
188Case SpecialType.System_Boolean
190Case SpecialType.System_Char
192Case SpecialType.System_SByte
194Case SpecialType.System_Byte
196Case SpecialType.System_Int16
198Case SpecialType.System_UInt16
200Case SpecialType.System_Int32
202Case SpecialType.System_UInt32
204Case SpecialType.System_Int64
206Case SpecialType.System_UInt64
208Case SpecialType.System_Decimal
210Case SpecialType.System_Single
212Case SpecialType.System_Double
214Case SpecialType.System_String
216Case SpecialType.System_IntPtr, SpecialType.System_UIntPtr
218Case SpecialType.System_Array
220Case SpecialType.System_DateTime
228Public Function GetDisplayName(this As SpecialType) As String
235Public Function TryGetKeywordText(this As SpecialType) As String
237Case SpecialType.System_SByte
239Case SpecialType.System_Int16
241Case SpecialType.System_Int32
243Case SpecialType.System_Int64
245Case SpecialType.System_Byte
247Case SpecialType.System_UInt16
249Case SpecialType.System_UInt32
251Case SpecialType.System_UInt64
253Case SpecialType.System_Single
255Case SpecialType.System_Double
257Case SpecialType.System_Decimal
259Case SpecialType.System_Char
261Case SpecialType.System_Boolean
263Case SpecialType.System_String
265Case SpecialType.System_Object
267Case SpecialType.System_DateTime
269Case SpecialType.System_Void
277Friend Function ToConstantValueDiscriminator(this As SpecialType) As ConstantValueTypeDiscriminator
279Case SpecialType.System_SByte
281Case SpecialType.System_Byte
283Case SpecialType.System_Int16
285Case SpecialType.System_UInt16
287Case SpecialType.System_Int32
289Case SpecialType.System_UInt32
291Case SpecialType.System_Int64
293Case SpecialType.System_UInt64
295Case SpecialType.System_Char
297Case SpecialType.System_Boolean
299Case SpecialType.System_Single
301Case SpecialType.System_Double
303Case SpecialType.System_Decimal
305Case SpecialType.System_DateTime
307Case SpecialType.System_String
315Friend Function GetShiftSizeMask(this As SpecialType) As Integer
317Case SpecialType.System_SByte, SpecialType.System_Byte
320Case SpecialType.System_Int16, SpecialType.System_UInt16
323Case SpecialType.System_Int32, SpecialType.System_UInt32
326Case SpecialType.System_Int64, SpecialType.System_UInt64
335Public Function ToRuntimeType(this As SpecialType) As Type
337Case SpecialType.System_SByte
339Case SpecialType.System_Int16
341Case SpecialType.System_Int32
343Case SpecialType.System_Int64
345Case SpecialType.System_Byte
347Case SpecialType.System_UInt16
349Case SpecialType.System_UInt32
351Case SpecialType.System_UInt64
353Case SpecialType.System_Single
355Case SpecialType.System_Double
357Case SpecialType.System_Decimal
359Case SpecialType.System_Char
361Case SpecialType.System_Boolean
363Case SpecialType.System_String
365Case SpecialType.System_Object
367Case SpecialType.System_DateTime
369Case SpecialType.System_Void
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\PredefinedTypeExtensions.cs (21)
11public static SpecialType ToSpecialType(this PredefinedType predefinedType)
14PredefinedType.Object => SpecialType.System_Object,
15PredefinedType.Void => SpecialType.System_Void,
16PredefinedType.Boolean => SpecialType.System_Boolean,
17PredefinedType.Char => SpecialType.System_Char,
18PredefinedType.SByte => SpecialType.System_SByte,
19PredefinedType.Byte => SpecialType.System_Byte,
20PredefinedType.Int16 => SpecialType.System_Int16,
21PredefinedType.UInt16 => SpecialType.System_UInt16,
22PredefinedType.Int32 => SpecialType.System_Int32,
23PredefinedType.UInt32 => SpecialType.System_UInt32,
24PredefinedType.Int64 => SpecialType.System_Int64,
25PredefinedType.UInt64 => SpecialType.System_UInt64,
26PredefinedType.Decimal => SpecialType.System_Decimal,
27PredefinedType.Single => SpecialType.System_Single,
28PredefinedType.Double => SpecialType.System_Double,
29PredefinedType.String => SpecialType.System_String,
30PredefinedType.DateTime => SpecialType.System_DateTime,
31PredefinedType.IntPtr => SpecialType.System_IntPtr,
32PredefinedType.UIntPtr => SpecialType.System_UIntPtr,
33_ => SpecialType.None,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SpecialTypeExtensions.cs (20)
11public static PredefinedType ToPredefinedType(this SpecialType specialType)
14SpecialType.System_Object => PredefinedType.Object,
15SpecialType.System_Void => PredefinedType.Void,
16SpecialType.System_Boolean => PredefinedType.Boolean,
17SpecialType.System_Char => PredefinedType.Char,
18SpecialType.System_SByte => PredefinedType.SByte,
19SpecialType.System_Byte => PredefinedType.Byte,
20SpecialType.System_Int16 => PredefinedType.Int16,
21SpecialType.System_UInt16 => PredefinedType.UInt16,
22SpecialType.System_Int32 => PredefinedType.Int32,
23SpecialType.System_UInt32 => PredefinedType.UInt32,
24SpecialType.System_Int64 => PredefinedType.Int64,
25SpecialType.System_UInt64 => PredefinedType.UInt64,
26SpecialType.System_Decimal => PredefinedType.Decimal,
27SpecialType.System_Single => PredefinedType.Single,
28SpecialType.System_Double => PredefinedType.Double,
29SpecialType.System_String => PredefinedType.String,
30SpecialType.System_DateTime => PredefinedType.DateTime,
31SpecialType.System_IntPtr => PredefinedType.IntPtr,
32SpecialType.System_UIntPtr => PredefinedType.UIntPtr,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (12)
83public static bool IsSpecialType([NotNullWhen(true)] ITypeSymbol? type, SpecialType specialType)
136SpecialType.System_SByte => value is sbyte,
137SpecialType.System_Byte => value is byte,
138SpecialType.System_Int16 => value is short,
139SpecialType.System_UInt16 => value is ushort,
140SpecialType.System_Int32 => value is int,
141SpecialType.System_UInt32 => value is uint,
142SpecialType.System_Int64 => value is long,
143SpecialType.System_UInt64 => value is ulong,
144SpecialType.System_Decimal => value is decimal,
145SpecialType.System_Single => value is float,
146SpecialType.System_Double => value is double,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
34SpecialType specialType,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
39SpecialType specialType,