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 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)
1035if (boundArgument.Type?.SpecialType == SpecialType.System_Void)
1218TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1242TypeSymbol typedReferenceType = GetSpecialType(SpecialType.System_TypedReference, diagnostics, node);
1266TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1308TypeSymbol runtimeArgumentHandleType = GetSpecialType(SpecialType.System_RuntimeArgumentHandle, diagnostics, node);
1433this.GetSpecialType(SpecialType.System_Int32, diagnostics, node), hasErrors);
2521GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2524TypeSymbol intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
2531NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2609GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2611NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2638NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, operand);
4280this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)),
4381GetSpecialType(SpecialType.System_Int32, diagnostics, nonNullSyntax))
4462count = GenerateConversionForAssignment(GetSpecialType(SpecialType.System_Int32, diagnostics, node), count, diagnostics);
4606GetSpecialType(SpecialType.System_Int32, diagnostics, node))
4627if (constantValue == null || constantValue.IsBad || expression.Type.SpecialType != SpecialType.System_Int32)
4650var type = expression.Type.SpecialType;
4651if (type == SpecialType.System_Int32)
4656if (type == SpecialType.System_Int64)
4663Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64);
4767containingType.SpecialType == SpecialType.System_Object ||
4770if ((object)initializerType == null || containingType.SpecialType == SpecialType.System_Object) //e.g. when defining System.Object in source
5018if (baseType.SpecialType == SpecialType.System_Object)
5020if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object)
5219lengthOrCount = new BoundLiteral(expression.Syntax, ConstantValue.Create(length), @this.GetSpecialType(SpecialType.System_Int32, diagnostics, expression.Syntax)) { WasCompilerGenerated = true };
6152NamedTypeSymbol collectionsIEnumerableType = this.GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, node);
6333type: GetSpecialType(SpecialType.System_Void, diagnostics, elementInitializer),
7157var specialType = type.SpecialType;
7166case SpecialType.System_SByte:
7167case SpecialType.System_Int16:
7168case SpecialType.System_Int32:
7169case SpecialType.System_Int64:
7170case SpecialType.System_Byte:
7171case SpecialType.System_UInt16:
7172case SpecialType.System_UInt32:
7173case SpecialType.System_UInt64:
7174case SpecialType.System_Single:
7175case SpecialType.System_Double:
7176case SpecialType.System_Decimal:
7177case SpecialType.System_Boolean:
7178case SpecialType.System_Char:
7223specialType != SpecialType.None &&
7224specialType != SpecialType.System_Byte &&
7225specialType != SpecialType.System_SByte &&
7226specialType != SpecialType.System_Int16 &&
7227specialType != SpecialType.System_UInt16);
7254var type = GetWellKnownType(WellKnownType.System_ReadOnlySpan_T, diagnostics, node).Construct(GetSpecialType(SpecialType.System_Byte, diagnostics, node));
8970BoundExpression convertedIndex = TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics);
9058if (convertedIndex.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex })
9139if (hatExpression.Operand.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex })
9145else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand })
9152arguments[0] is { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex1 } } index &&
9153arguments[1] is { ConstantValueOpt: { SpecialType: SpecialType.System_Boolean, BooleanValue: bool isFromEnd } })
9274var int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
9309TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics) ??
9310TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt32, node, diagnostics) ??
9311TryImplicitConversionToArrayIndex(index, SpecialType.System_Int64, node, diagnostics) ??
9312TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt64, node, diagnostics);
9346NamedTypeSymbol int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
9380private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics)
9940original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
9942var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
9958else if (receiver.Type.SpecialType == SpecialType.System_String)
10013var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10014var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10038original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } &&
10039original.Parameters[1] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None };
10101getMethod.ReturnType.SpecialType == SpecialType.System_Int32 &&
10826accessType = GetSpecialType(SpecialType.System_Void, diagnostics, node);
10834accessType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node).Construct(accessType);
Binder\Binder_InterpolatedString.cs (15)
41var stringType = GetSpecialType(SpecialType.System_String, diagnostics, node);
55var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
167var constantValue = ConstantValue.Create(text, SpecialType.System_String);
243Debug.Assert(unconvertedInterpolatedString.Parts.All(static part => part.Type is null or { SpecialType: SpecialType.System_String }));
298=> parts.All(p => p is BoundLiteral or BoundStringInsert { Value.Type.SpecialType: SpecialType.System_String, Alignment: null, Format: null });
379var @string = GetSpecialType(SpecialType.System_String, diagnostics, rootSyntax);
536TypeSymbol objectType = GetSpecialType(SpecialType.System_Object, diagnostics, syntax);
573var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, syntax);
584var boolType = GetSpecialType(SpecialType.System_Boolean, diagnostics, syntax);
715var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, unconvertedInterpolatedString.Syntax);
749Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String } });
847bool methodReturnsBool = returnType.SpecialType == SpecialType.System_Boolean;
848if (!methodReturnsBool && returnType.SpecialType != SpecialType.System_Void)
860var 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);
2299return 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);
1300return GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
1451(operand.Type.SpecialType == SpecialType.System_UInt64 || isNuint(operand.Type)))
1482return type.SpecialType == SpecialType.System_UIntPtr
1685internal static SpecialType GetEnumPromotedType(SpecialType underlyingType)
1689case SpecialType.System_Byte:
1690case SpecialType.System_SByte:
1691case SpecialType.System_Int16:
1692case SpecialType.System_UInt16:
1693return SpecialType.System_Int32;
1695case SpecialType.System_Int32:
1696case SpecialType.System_UInt32:
1697case SpecialType.System_Int64:
1698case SpecialType.System_UInt64:
1735SpecialType operandSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
1761Debug.Assert(resultTypeSymbol.SpecialType == SpecialType.System_Boolean);
1770if (resultTypeSymbol.SpecialType != SpecialType.System_Boolean && constantValue != null && !constantValue.IsBad)
1830SpecialType resultType = resultTypeSymbol.SpecialType;
2819var upconvertSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
2868SpecialType resultType = resultTypeSymbol.SpecialType;
3104return new BoundLiteral(node, ConstantValue.Create((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node));
3119return new BoundLiteral(node, ConstantValue.Create(-9223372036854775808), GetSpecialType(SpecialType.System_Int64, diagnostics, node));
3219var resultType = (TypeSymbol)GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3316GetSpecialType(SpecialType.System_Object, diagnostics, node).Name // a pretty way of getting the string "Object"
3325operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3508if (operandType.IsValueType && targetType.IsClassType() && targetType.SpecialType != SpecialType.System_Enum ||
3509targetType.IsValueType && operandType.IsClassType() && operandType.SpecialType != SpecialType.System_Enum)
3792type: GetSpecialType(SpecialType.System_Object, diagnostics, node));
3810operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3817targetType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
4047var 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)
1277if (initializerType.SpecialType == SpecialType.System_String &&
1278((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String))
1281elementType = this.GetSpecialType(SpecialType.System_Char, diagnostics, initializerSyntax);
1514type = this.GetSpecialType(SpecialType.System_Void, diagnostics, node);
2209if (sourceType.SpecialType == SpecialType.System_Double && syntax.Kind() == SyntaxKind.NumericLiteralExpression &&
2210(targetType.SpecialType == SpecialType.System_Single || targetType.SpecialType == SpecialType.System_Decimal))
2212Error(diagnostics, ErrorCode.ERR_LiteralDoubleCast, syntax, (targetType.SpecialType == SpecialType.System_Single) ? "F" : "M", targetType);
2544var boolean = GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3419else if (expression.Type?.SpecialType == SpecialType.System_Void)
3732if (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);
1631internal NamedTypeSymbol GetSpecialType(SpecialType typeId, BindingDiagnosticBag diagnostics, SyntaxNode node)
1636internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, SyntaxNode node, BindingDiagnosticBag diagnostics)
1644internal 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)
1538case (SpecialType.System_SByte, SpecialType.System_Byte):
1539case (SpecialType.System_Byte, SpecialType.System_SByte):
1540case (SpecialType.System_Int16, SpecialType.System_UInt16):
1541case (SpecialType.System_UInt16, SpecialType.System_Int16):
1542case (SpecialType.System_Int32, SpecialType.System_UInt32):
1543case (SpecialType.System_UInt32, SpecialType.System_Int32):
1544case (SpecialType.System_Int64, SpecialType.System_UInt64):
1545case (SpecialType.System_UInt64, SpecialType.System_Int64):
1546case (SpecialType.System_IntPtr, SpecialType.System_UIntPtr):
1547case (SpecialType.System_UIntPtr, SpecialType.System_IntPtr):
1552case (SpecialType.System_Int32, SpecialType.System_IntPtr):
1553case (SpecialType.System_Int32, SpecialType.System_UIntPtr):
1554case (SpecialType.System_UInt32, SpecialType.System_IntPtr):
1555case (SpecialType.System_UInt32, SpecialType.System_UIntPtr):
1556case (SpecialType.System_IntPtr, SpecialType.System_Int32):
1557case (SpecialType.System_IntPtr, SpecialType.System_UInt32):
1558case (SpecialType.System_UIntPtr, SpecialType.System_Int32):
1559case (SpecialType.System_UIntPtr, SpecialType.System_UInt32):
1564case (SpecialType.System_Int64, SpecialType.System_IntPtr):
1565case (SpecialType.System_Int64, SpecialType.System_UIntPtr):
1566case (SpecialType.System_UInt64, SpecialType.System_IntPtr):
1567case (SpecialType.System_UInt64, SpecialType.System_UIntPtr):
1568case (SpecialType.System_IntPtr, SpecialType.System_Int64):
1569case (SpecialType.System_IntPtr, SpecialType.System_UInt64):
1570case (SpecialType.System_UIntPtr, SpecialType.System_Int64):
1571case (SpecialType.System_UIntPtr, SpecialType.System_UInt64):
Binder\ForEachLoopBinder.cs (22)
258if (!hasErrors && awaitInfo.GetResult?.ReturnType.SpecialType != SpecialType.System_Boolean)
574(collectionConversionClassification.Kind == ConversionKind.ExplicitReference && collectionExpr.Type.SpecialType == SpecialType.System_String));
682else if (collectionExpr.Type.SpecialType == SpecialType.System_String && builder.CollectionType.SpecialType == SpecialType.System_Collections_IEnumerable)
688inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax));
997if (!isAsync && collectionExprType.SpecialType == SpecialType.System_String)
1061this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T));
1099Debug.Assert(collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
1158Debug.Assert(collectionType.SpecialType == SpecialType.System_Collections_IEnumerable);
1163builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax));
1166builder.GetEnumeratorInfo.Method.ReturnType.SpecialType == SpecialType.System_Collections_IEnumerator);
1258NamedTypeSymbol targetInterface = isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable);
1280builder.CollectionType = GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, syntax);
1287GetSpecialType(SpecialType.System_Object, diagnostics, syntax));
1291builder.ElementTypeWithAnnotations = collectionExprType.SpecialType == SpecialType.System_String ?
1292TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, syntax)) :
1304TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1706return moveNextMethodCandidate.OriginalDefinition.ReturnType.SpecialType != SpecialType.System_Boolean;
1724case SpecialType.System_Collections_IEnumerable:
1725case SpecialType.System_Collections_Generic_IEnumerable_T:
1766var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable);
1845return 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 (84)
250var sourceIsVoid = source?.SpecialType == SpecialType.System_Void;
251var destIsVoid = destination.SpecialType == SpecialType.System_Void;
1347var specialSource = source.Type.GetSpecialTypeSafe();
1349if (specialSource == SpecialType.System_Int32)
1355case SpecialType.System_Byte:
1357case SpecialType.System_SByte:
1359case SpecialType.System_Int16:
1361case SpecialType.System_IntPtr when destination.IsNativeIntegerType:
1363case SpecialType.System_UInt32:
1364case SpecialType.System_UIntPtr when destination.IsNativeIntegerType:
1366case SpecialType.System_UInt64:
1368case SpecialType.System_UInt16:
1374else if (specialSource == SpecialType.System_Int64 && destination.GetSpecialTypeSafe() == SpecialType.System_UInt64 && (constantValue.IsBad || 0 <= constantValue.Int64Value))
1605var multicastDelegateType = corLibrary.GetSpecialType(SpecialType.System_MulticastDelegate);
1665else if (implementsSpecialInterface(compilation, destination, SpecialType.System_Collections_IEnumerable))
1684static bool implementsSpecialInterface(CSharpCompilation compilation, TypeSymbol targetType, SpecialType specialInterface)
1742TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_Int32);
1769TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_String);
2080case SpecialType.System_Char:
2081case SpecialType.System_SByte:
2082case SpecialType.System_Byte:
2083case SpecialType.System_Int16:
2084case SpecialType.System_UInt16:
2085case SpecialType.System_Int32:
2086case SpecialType.System_UInt32:
2087case SpecialType.System_Int64:
2088case SpecialType.System_UInt64:
2089case SpecialType.System_Single:
2090case SpecialType.System_Double:
2091case SpecialType.System_Decimal:
2092case SpecialType.System_IntPtr when type.IsNativeIntegerType:
2093case SpecialType.System_UIntPtr when type.IsNativeIntegerType:
2165case SpecialType.System_SByte:
2166case SpecialType.System_Byte:
2167case SpecialType.System_Int16:
2168case SpecialType.System_UInt16:
2169case SpecialType.System_Char:
2170case SpecialType.System_Int32:
2171case SpecialType.System_UInt32:
2172case SpecialType.System_Int64:
2173case SpecialType.System_UInt64:
2174case SpecialType.System_Double:
2175case SpecialType.System_Single:
2176case SpecialType.System_Decimal:
2183(type.SpecialType == SpecialType.System_IntPtr || type.SpecialType == SpecialType.System_UIntPtr) && !type.IsNativeIntegerType;
2552if (destination.SpecialType == SpecialType.System_Collections_IEnumerable)
2622if (destination.SpecialType == SpecialType.System_Object || destination.Kind == SymbolKind.DynamicType)
2716if (destination.GetSpecialTypeSafe() == SpecialType.System_Array)
2721if (IsBaseInterface(destination, this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Array), ref useSiteInfo))
2754var specialDestination = destination.GetSpecialTypeSafe();
2756if (specialDestination == SpecialType.System_MulticastDelegate ||
2757specialDestination == SpecialType.System_Delegate ||
2758IsBaseInterface(destination, this.corLibrary.GetDeclaredSpecialType(SpecialType.System_MulticastDelegate), ref useSiteInfo))
2787if (destination.SpecialType == SpecialType.System_MulticastDelegate)
2797var derivedType = this.corLibrary.GetDeclaredSpecialType(SpecialType.System_MulticastDelegate);
3350return source.IsPointerOrFunctionPointer() && destination is PointerTypeSymbol { PointedAtType: { SpecialType: SpecialType.System_Void } };
3441if (source.SpecialType == SpecialType.System_Object)
3619if (source.SpecialType == SpecialType.System_Delegate || source.SpecialType == SpecialType.System_MulticastDelegate)
3624if (HasImplicitConversionToInterface(this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Delegate), source, ref useSiteInfo))
3726if (source.SpecialType == SpecialType.System_Array)
3731foreach (var iface in this.corLibrary.GetDeclaredSpecialType(SpecialType.System_Array).AllInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo))
3760var specialDefinition = ((TypeSymbol)source.OriginalDefinition).SpecialType;
3762if (specialDefinition == SpecialType.System_Collections_Generic_IList_T ||
3763specialDefinition == SpecialType.System_Collections_Generic_ICollection_T ||
3764specialDefinition == SpecialType.System_Collections_Generic_IEnumerable_T ||
3765specialDefinition == SpecialType.System_Collections_Generic_IReadOnlyList_T ||
3766specialDefinition == SpecialType.System_Collections_Generic_IReadOnlyCollection_T)
3809var specialTypeSource = source.SpecialType;
3811if (specialTypeSource == SpecialType.System_Object || specialTypeSource == SpecialType.System_ValueType)
3830if (source.SpecialType == SpecialType.System_Enum && destination.IsEnumType())
3903case SpecialType.System_SByte:
3904case SpecialType.System_Byte:
3905case SpecialType.System_Int16:
3906case SpecialType.System_UInt16:
3907case SpecialType.System_Int32:
3908case SpecialType.System_UInt32:
3909case SpecialType.System_Int64:
3910case SpecialType.System_UInt64:
3912case SpecialType.System_IntPtr:
3913case SpecialType.System_UIntPtr:
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)));
1046return 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);
145Debug.Assert(byteArray.ElementType.SpecialType == SpecialType.System_Byte);
228if (type.SpecialType != SpecialType.System_Double && type.SpecialType != SpecialType.System_Single)
434if (rewrittenType.SpecialType == SpecialType.System_Decimal || rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
497if (rewrittenType.SpecialType == SpecialType.System_Decimal)
504else if (rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
603createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
608createSpan = _factory.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax, spanType.OriginalDefinition, _factory.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
665SpecialType GetUnderlyingSpecialType(TypeSymbol type) =>
668bool IsInRange(SpecialType type, SpecialType low, SpecialType high) =>
671SpecialType sourceST = GetUnderlyingSpecialType(source);
672SpecialType targetST = GetUnderlyingSpecialType(target);
677IsInRange(sourceST, SpecialType.System_Char, SpecialType.System_Double) &&
678IsInRange(targetST, SpecialType.System_Char, SpecialType.System_UInt64);
724rewrittenOperand.Type.SpecialType != SpecialType.System_Decimal &&
725rewrittenOperand.Type.SpecialType != SpecialType.System_DateTime)
1009if (!TypeSymbol.Equals(typeFrom, typeTo, TypeCompareKind.ConsiderEverything2) && (typeFrom.SpecialType == SpecialType.System_Decimal || typeTo.SpecialType == SpecialType.System_Decimal))
1446SpecialType t0Type = t0.IsEnumType() ? t0.GetEnumUnderlyingType()!.SpecialType : t0.SpecialType;
1447SpecialType s0Type = s0.IsEnumType() ? s0.GetEnumUnderlyingType()!.SpecialType : s0.SpecialType;
1449if (t0Type == SpecialType.System_IntPtr)
1458case SpecialType.System_Byte:
1459case SpecialType.System_SByte:
1460case SpecialType.System_Int16:
1461case SpecialType.System_UInt16:
1462case SpecialType.System_Char:
1463case SpecialType.System_Int32:
1465case SpecialType.System_UInt32:
1466case SpecialType.System_UInt64:
1467case SpecialType.System_Int64:
1468case SpecialType.System_Single:
1469case SpecialType.System_Double:
1470case SpecialType.System_Decimal:
1474else if (t0Type == SpecialType.System_UIntPtr)
1483case SpecialType.System_Byte:
1484case SpecialType.System_UInt16:
1485case SpecialType.System_Char:
1486case SpecialType.System_UInt32:
1488case SpecialType.System_SByte:
1489case SpecialType.System_Int16:
1490case SpecialType.System_Int32:
1491case SpecialType.System_UInt64:
1492case SpecialType.System_Int64:
1493case SpecialType.System_Single:
1494case SpecialType.System_Double:
1495case SpecialType.System_Decimal:
1499else if (s0Type == SpecialType.System_IntPtr)
1508case SpecialType.System_Byte:
1509case SpecialType.System_SByte:
1510case SpecialType.System_Int16:
1511case SpecialType.System_UInt16:
1512case SpecialType.System_Char:
1513case SpecialType.System_UInt32:
1514case SpecialType.System_Int32:
1516case SpecialType.System_UInt64:
1517case SpecialType.System_Int64:
1518case SpecialType.System_Single:
1519case SpecialType.System_Double:
1520case SpecialType.System_Decimal:
1524else if (s0Type == SpecialType.System_UIntPtr)
1533case SpecialType.System_SByte:
1534case SpecialType.System_Int16:
1535case SpecialType.System_Int32:
1536case SpecialType.System_Byte:
1537case SpecialType.System_UInt16:
1538case SpecialType.System_Char:
1539case SpecialType.System_UInt32:
1541case SpecialType.System_UInt64:
1542case SpecialType.System_Int64:
1543case SpecialType.System_Single:
1544case SpecialType.System_Double:
1545case SpecialType.System_Decimal:
1556if (typeFrom.SpecialType == SpecialType.System_Decimal)
1561case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Explicit_ToChar;
1562case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Explicit_ToSByte;
1563case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Explicit_ToByte;
1564case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Explicit_ToInt16;
1565case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Explicit_ToUInt16;
1566case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Explicit_ToInt32;
1567case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Explicit_ToUInt32;
1568case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Explicit_ToInt64;
1569case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Explicit_ToUInt64;
1570case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_ToSingle;
1571case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_ToDouble;
1581case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Implicit_FromChar;
1582case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Implicit_FromSByte;
1583case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Implicit_FromByte;
1584case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Implicit_FromInt16;
1585case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Implicit_FromUInt16;
1586case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Implicit_FromInt32;
1587case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Implicit_FromUInt32;
1588case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Implicit_FromInt64;
1589case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Implicit_FromUInt64;
1590case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_FromSingle;
1591case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_FromDouble;
1600Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal);
1602if (fromType.SpecialType == SpecialType.System_Decimal)
1606case SpecialType.System_IntPtr:
1607case SpecialType.System_UIntPtr:
1608operand = RewriteDecimalConversionCore(syntax, operand, fromType, get64BitType(_compilation, signed: toType.SpecialType == SpecialType.System_IntPtr), isImplicit, constantValueOpt);
1616case SpecialType.System_IntPtr:
1617case SpecialType.System_UIntPtr:
1618operand = MakeConversionNode(operand, get64BitType(_compilation, signed: fromType.SpecialType == SpecialType.System_IntPtr), @checked);
1626static TypeSymbol get64BitType(CSharpCompilation compilation, bool signed) => compilation.GetSpecialType(signed ? SpecialType.System_Int64 : SpecialType.System_UInt64);
1706if (fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal)
1721if (fromType.SpecialType == SpecialType.System_Decimal)
1734else 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)
339public NamedTypeSymbol SpecialType(SpecialType st)
696return new BoundIsOperator(this.Syntax, operand, Type(type), c.Kind, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
701Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
702Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
703return Binary(BinaryOperatorKind.LogicalBoolAnd, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
708Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
709Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
710return Binary(BinaryOperatorKind.LogicalBoolOr, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
715return Binary(BinaryOperatorKind.IntEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
720return Binary(BinaryOperatorKind.ObjectEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
725var objectType = SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Object);
731return Binary(BinaryOperatorKind.ObjectNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
736return Binary(BinaryOperatorKind.IntNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
741return Binary(BinaryOperatorKind.IntLessThan, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
746return Binary(BinaryOperatorKind.IntGreaterThanOrEqual, SpecialType(CodeAnalysis.SpecialType.System_Boolean), left, right);
751return Binary(BinaryOperatorKind.IntSubtraction, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
756return Binary(BinaryOperatorKind.IntMultiplication, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
761return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Byte)) { WasCompilerGenerated = true };
766return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
774return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt32)) { WasCompilerGenerated = true };
825case { SpecialType: CodeAnalysis.SpecialType.System_Double }:
828case { SpecialType: CodeAnalysis.SpecialType.System_Single }:
1121Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 });
1183return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
1195return new BoundLiteral(Syntax, stringConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1206return new BoundLiteral(Syntax, charConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Char)) { WasCompilerGenerated = true };
1217return new BoundArrayLength(Syntax, array, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32));
1348return new BoundSizeOfOperator(Syntax, Type(type), Binder.GetConstantSizeOf(type), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
1374SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1384SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1394SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1402SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt64))
1417return new BoundModuleVersionIdString(Syntax, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1426=> new BoundThrowIfModuleCancellationRequested(Syntax, SpecialType(CodeAnalysis.SpecialType.System_Void)) { WasCompilerGenerated = true };
1435SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1447SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1678Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } });
1811TypeSymbol boolType = Compilation.GetSpecialType(CodeAnalysis.SpecialType.System_Boolean);
1825TypeSymbol objectType = SpecialType(CodeAnalysis.SpecialType.System_Object);
1878Debug.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)
938string? name = attributeData.GetConstructorArgument<string>(0, SpecialType.System_String);
1012int length = attributeData.GetConstructorArgument<int>(0, SpecialType.System_Int32);
1032string? methodName = attributeData.GetConstructorArgument<string>(1, SpecialType.System_String);
1051Debug.Assert(this.SpecialType == SpecialType.System_Object || this.DeclaringCompilation.IsAttributeType(this));
1192string? methodName = attribute.CommonConstructorArguments[1].DecodeValue<string>(SpecialType.System_String);
1204int length = attribute.CommonConstructorArguments[0].DecodeValue<int>(SpecialType.System_Int32);
1393string name = attribute.GetConstructorArgument<string>(0, SpecialType.System_String);
1588if ((object)baseType != null && baseType.SpecialType != SpecialType.System_Object)
1693new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message
1694new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true
1699ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))),
1712var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
1757Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr);
1843(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
1435GetSpecialType(SpecialType.System_Object, expr.Syntax, diagnostics), Nothing)
1535(originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
1536originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IList_T OrElse
1537originalTargetType.SpecialType = SpecialType.System_Collections_Generic_ICollection_T OrElse
1538originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyList_T OrElse
1539originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyCollection_T) Then
1940dominantType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
2007dominantType = If(boundFirstArg.Type, If(boundSecondArg.Type, GetSpecialType(SpecialType.System_Object, node, diagnostics)))
2479MemberLookup.GetTypeForIntrinsicAlias(name) <> SpecialType.None Then
3744GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3761If type.SpecialType = SpecialType.System_Object OrElse type.IsExtensibleInterfaceNoUseSiteDiagnostics() Then
3763Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3782Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3799If type.SpecialType = SpecialType.System_Array Then
3825GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3868Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3891Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3893If specialType <> specialType.None Then
3915Dim int32Type = GetSpecialType(SpecialType.System_Int32, node.ArgumentList, diagnostics)
4126Dim Int32Type = GetSpecialType(SpecialType.System_Int32, node, diagnostics)
4210inferredElementType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
4342Dim int32Type = GetSpecialType(SpecialType.System_Int32, arrayBoundsOpt, diagnostics)
4457Dim specialType As SpecialType = SpecialTypeExtensions.FromRuntimeTypeOfLiteralValue(value)
4460Debug.Assert(specialType <> specialType.None AndAlso
4461specialType <> specialType.System_Byte AndAlso
4462specialType <> specialType.System_SByte)
4596Debug.Assert(dominantType.IsArrayType AndAlso DirectCast(dominantType, ArrayTypeSymbol).Rank = 1 AndAlso DirectCast(dominantType, ArrayTypeSymbol).ElementType.SpecialType = SpecialType.System_Object)
4602dominantType = GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
4607dominantType = 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)
1011Dim baseCorTypeId As SpecialType = base.SpecialType
1013If baseCorTypeId = SpecialType.System_Enum Then
1016ElseIf baseCorTypeId = SpecialType.System_MulticastDelegate OrElse
1017(baseCorTypeId = SpecialType.System_Delegate AndAlso Me.SpecialType <> SpecialType.System_MulticastDelegate) Then
1020ElseIf (baseCorTypeId = SpecialType.System_ValueType AndAlso
1021Me.SpecialType <> SpecialType.System_Enum) Then
1141Case SpecialType.System_Void,
1142SpecialType.System_Boolean,
1143SpecialType.System_Char,
1144SpecialType.System_Byte,
1145SpecialType.System_SByte,
1146SpecialType.System_Int16,
1147SpecialType.System_UInt16,
1148SpecialType.System_Int32,
1149SpecialType.System_UInt32,
1150SpecialType.System_Int64,
1151SpecialType.System_UInt64,
1152SpecialType.System_Single,
1153SpecialType.System_Double,
1154SpecialType.System_Decimal,
1155SpecialType.System_IntPtr,
1156SpecialType.System_UIntPtr,
1157SpecialType.System_DateTime,
1158SpecialType.System_TypedReference,
1159SpecialType.System_ArgIterator,
1160SpecialType.System_RuntimeArgumentHandle,
1161SpecialType.System_RuntimeFieldHandle,
1162SpecialType.System_RuntimeMethodHandle,
1163SpecialType.System_RuntimeTypeHandle
1316specialtype <> SpecialType.System_Enum AndAlso specialtype <> SpecialType.System_MulticastDelegate Then
1319If base IsNot Nothing AndAlso base.SpecialType = SpecialType.None AndAlso base.ContainingAssembly?.IsMissing Then
1326Case SpecialType.System_Enum,
1327SpecialType.System_Delegate,
1328SpecialType.System_MulticastDelegate,
1329SpecialType.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)
1252Private Function IsRestrictedBaseClass(type As SpecialType) As Boolean
1254Case SpecialType.System_Array,
1255SpecialType.System_Delegate,
1256SpecialType.System_MulticastDelegate,
1257SpecialType.System_Enum,
1258SpecialType.System_ValueType
1378ReportUseSiteInfoForBaseType(Me.DeclaringCompilation.GetSpecialType(SpecialType.System_Object), declaredBase, diagnostics)
1382declaredOrDefaultBase = GetSpecialType(SpecialType.System_Object)
1388declaredOrDefaultBase = GetSpecialType(SpecialType.System_Enum)
1391declaredOrDefaultBase = GetSpecialType(SpecialType.System_ValueType)
1394declaredOrDefaultBase = GetSpecialType(SpecialType.System_MulticastDelegate)
1397declaredOrDefaultBase = GetSpecialType(SpecialType.System_Object)
1417Private Function GetSpecialType(type As SpecialType) As NamedTypeSymbol
1507Return GetSpecialType(SpecialType.System_Enum)
1510Return GetSpecialType(SpecialType.System_MulticastDelegate)
2041Dim conditionalSymbol As String = attrdata.GetConstructorArgument(Of String)(0, SpecialType.System_String)
2480Dim stringType = GetSpecialType(SpecialType.System_String)
2502New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId))))
2508New TypedConstant(GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Enum, CInt(ClassInterfaceType.None)))))
2529New 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 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,