Binder\Binder_Expressions.cs (66)
1001if (boundArgument.Type?.SpecialType == SpecialType.System_Void)
1184TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1208TypeSymbol typedReferenceType = GetSpecialType(SpecialType.System_TypedReference, diagnostics, node);
1232TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1274TypeSymbol runtimeArgumentHandleType = GetSpecialType(SpecialType.System_RuntimeArgumentHandle, diagnostics, node);
1399this.GetSpecialType(SpecialType.System_Int32, diagnostics, node), hasErrors);
2349GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2352TypeSymbol intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
2359NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2437GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
2439NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, node);
2466NamedTypeSymbol nullableType = GetSpecialType(SpecialType.System_Nullable_T, diagnostics, operand);
3664this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)),
3765GetSpecialType(SpecialType.System_Int32, diagnostics, nonNullSyntax))
3846count = GenerateConversionForAssignment(GetSpecialType(SpecialType.System_Int32, diagnostics, node), count, diagnostics);
3990GetSpecialType(SpecialType.System_Int32, diagnostics, node))
4011if (constantValue == null || constantValue.IsBad || expression.Type.SpecialType != SpecialType.System_Int32)
4034var type = expression.Type.SpecialType;
4035if (type == SpecialType.System_Int32)
4040if (type == SpecialType.System_Int64)
4047Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64);
4152containingType.SpecialType == SpecialType.System_Object ||
4155if ((object)initializerType == null || containingType.SpecialType == SpecialType.System_Object) //e.g. when defining System.Object in source
4375if (baseType.SpecialType == SpecialType.System_Object)
4377if (resultMember is null || resultMember.ContainingType.SpecialType != SpecialType.System_Object)
5373TypeSymbol collectionsIEnumerableType = this.GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, node);
5513type: GetSpecialType(SpecialType.System_Void, diagnostics, elementInitializer),
6189var specialType = type.SpecialType;
6198case SpecialType.System_SByte:
6199case SpecialType.System_Int16:
6200case SpecialType.System_Int32:
6201case SpecialType.System_Int64:
6202case SpecialType.System_Byte:
6203case SpecialType.System_UInt16:
6204case SpecialType.System_UInt32:
6205case SpecialType.System_UInt64:
6206case SpecialType.System_Single:
6207case SpecialType.System_Double:
6208case SpecialType.System_Decimal:
6209case SpecialType.System_Boolean:
6210case SpecialType.System_Char:
6251var specialType = SpecialTypeExtensions.FromRuntimeTypeOfLiteralValue(value);
6255specialType != SpecialType.None &&
6256specialType != SpecialType.System_Byte &&
6257specialType != SpecialType.System_SByte &&
6258specialType != SpecialType.System_Int16 &&
6259specialType != SpecialType.System_UInt16);
6286var type = GetWellKnownType(WellKnownType.System_ReadOnlySpan_T, diagnostics, node).Construct(GetSpecialType(SpecialType.System_Byte, diagnostics, node));
8032var int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
8067TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics) ??
8068TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt32, node, diagnostics) ??
8069TryImplicitConversionToArrayIndex(index, SpecialType.System_Int64, node, diagnostics) ??
8070TryImplicitConversionToArrayIndex(index, SpecialType.System_UInt64, node, diagnostics);
8104NamedTypeSymbol int32 = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
8138private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics)
8675original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
8677var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
8693else if (receiver.Type.SpecialType == SpecialType.System_String)
8732original.Parameters[0] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None } &&
8733original.Parameters[1] is { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.None })
8752var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
8753var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
8831getMethod.ReturnType.SpecialType == SpecialType.System_Int32 &&
9412accessType = GetSpecialType(SpecialType.System_Void, diagnostics, node);
9420accessType = 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 });
371var @string = GetSpecialType(SpecialType.System_String, diagnostics, rootSyntax);
528TypeSymbol objectType = GetSpecialType(SpecialType.System_Object, diagnostics, syntax);
565var intType = GetSpecialType(SpecialType.System_Int32, diagnostics, syntax);
576var boolType = GetSpecialType(SpecialType.System_Boolean, diagnostics, syntax);
685var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, unconvertedInterpolatedString.Syntax);
719Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String } });
817bool methodReturnsBool = returnType.SpecialType == SpecialType.System_Boolean;
818if (!methodReturnsBool && returnType.SpecialType != SpecialType.System_Void)
830var expected = builderPatternExpectsBool == true ? Compilation.GetSpecialType(SpecialType.System_Boolean) : Compilation.GetSpecialType(SpecialType.System_Void);
Binder\Binder_Invocation.cs (12)
196TypeSymbol objType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
1167Debug.Assert(parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object);
1377defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
1382defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1387defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1391&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists
1396defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1401if (parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object)
1421if (InAttributeArgument && parameterType.SpecialType == SpecialType.System_Object)
1432if (!conversion.IsValid && defaultConstantValue is { SpecialType: SpecialType.System_Decimal or SpecialType.System_DateTime })
1911return 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);
707GetSpecialType(SpecialType.System_Boolean, diagnostics, node));
852namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte;
905if ((object)left.Type != null && left.Type.SpecialType == SpecialType.System_Boolean &&
906(object)right.Type != null && right.Type.SpecialType == SpecialType.System_Boolean)
956bool bothBool = signature.LeftType.SpecialType == SpecialType.System_Boolean &&
957signature.RightType.SpecialType == SpecialType.System_Boolean;
1035var booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean);
1269return GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
1420(operand.Type.SpecialType == SpecialType.System_UInt64 || isNuint(operand.Type)))
1451return type.SpecialType == SpecialType.System_UIntPtr
1654internal static SpecialType GetEnumPromotedType(SpecialType underlyingType)
1658case SpecialType.System_Byte:
1659case SpecialType.System_SByte:
1660case SpecialType.System_Int16:
1661case SpecialType.System_UInt16:
1662return SpecialType.System_Int32;
1664case SpecialType.System_Int32:
1665case SpecialType.System_UInt32:
1666case SpecialType.System_Int64:
1667case SpecialType.System_UInt64:
1704SpecialType operandSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
1730Debug.Assert(resultTypeSymbol.SpecialType == SpecialType.System_Boolean);
1739if (resultTypeSymbol.SpecialType != SpecialType.System_Boolean && constantValue != null && !constantValue.IsBad)
1799SpecialType resultType = resultTypeSymbol.SpecialType;
2776var upconvertSpecialType = GetEnumPromotedType(underlyingType.SpecialType);
2825SpecialType resultType = resultTypeSymbol.SpecialType;
3061return new BoundLiteral(node, ConstantValue.Create((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node));
3076return new BoundLiteral(node, ConstantValue.Create(-9223372036854775808), GetSpecialType(SpecialType.System_Int64, diagnostics, node));
3176var resultType = (TypeSymbol)GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3273GetSpecialType(SpecialType.System_Object, diagnostics, node).Name // a pretty way of getting the string "Object"
3282operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3465if (operandType.IsValueType && targetType.IsClassType() && targetType.SpecialType != SpecialType.System_Enum ||
3466targetType.IsValueType && operandType.IsClassType() && operandType.SpecialType != SpecialType.System_Enum)
3722type: GetSpecialType(SpecialType.System_Object, diagnostics, node));
3740operandType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3747targetType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
3972var objectType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
Binder\Binder_Patterns.cs (26)
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;
643if (expression.Type?.SpecialType == SpecialType.System_String && inputType.IsSpanOrReadOnlySpanChar())
815expressionType = conversions.CorLibrary.GetSpecialType(SpecialType.System_Object);
1105var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1132var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1251if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) &&
1481if (memberType.SpecialType == SpecialType.System_Int32 &&
1610bool isExplicitNotNullTest = patternType.Type.SpecialType == SpecialType.System_Object;
1687SpecialType.System_Single => BinaryOperatorKind.Float,
1688SpecialType.System_Double => BinaryOperatorKind.Double,
1689SpecialType.System_Char => BinaryOperatorKind.Char,
1690SpecialType.System_SByte => BinaryOperatorKind.Int, // operands are converted to int
1691SpecialType.System_Byte => BinaryOperatorKind.Int, // operands are converted to int
1692SpecialType.System_UInt16 => BinaryOperatorKind.Int, // operands are converted to int
1693SpecialType.System_Int16 => BinaryOperatorKind.Int, // operands are converted to int
1694SpecialType.System_Int32 => BinaryOperatorKind.Int,
1695SpecialType.System_UInt32 => BinaryOperatorKind.UInt,
1696SpecialType.System_Int64 => BinaryOperatorKind.Long,
1697SpecialType.System_UInt64 => BinaryOperatorKind.ULong,
1698SpecialType.System_Decimal => BinaryOperatorKind.Decimal,
1699SpecialType.System_String => BinaryOperatorKind.String,
1700SpecialType.System_Boolean => BinaryOperatorKind.Bool,
1701SpecialType.System_IntPtr when type.IsNativeIntegerType => BinaryOperatorKind.NInt,
1702SpecialType.System_UIntPtr when type.IsNativeIntegerType => BinaryOperatorKind.NUInt,
Binder\Binder_Statements.cs (11)
1287if (initializerType.SpecialType == SpecialType.System_String &&
1288((object)fixedPatternMethod == null || fixedPatternMethod.ContainingType.SpecialType != SpecialType.System_String))
1291elementType = this.GetSpecialType(SpecialType.System_Char, diagnostics, initializerSyntax);
1524type = this.GetSpecialType(SpecialType.System_Void, diagnostics, node);
2208if (sourceType.SpecialType == SpecialType.System_Double && syntax.Kind() == SyntaxKind.NumericLiteralExpression &&
2209(targetType.SpecialType == SpecialType.System_Single || targetType.SpecialType == SpecialType.System_Decimal))
2211Error(diagnostics, ErrorCode.ERR_LiteralDoubleCast, syntax, (targetType.SpecialType == SpecialType.System_Single) ? "F" : "M", targetType);
2539var boolean = GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
3414else if (expression.Type?.SpecialType == SpecialType.System_Void)
3727if (baseType.SpecialType == SpecialType.System_Object)
Binder\Binder_Symbols.cs (9)
991var specialType =
992node.IsNint ? SpecialType.System_IntPtr :
993node.IsNuint ? SpecialType.System_UIntPtr : SpecialType.None;
995if (specialType == SpecialType.None)
1058this.GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
1632internal NamedTypeSymbol GetSpecialType(SpecialType typeId, BindingDiagnosticBag diagnostics, SyntaxNode node)
1637internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, SyntaxNode node, BindingDiagnosticBag diagnostics)
1645internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, Location location, BindingDiagnosticBag diagnostics)
Binder\DecisionDagBuilder.cs (56)
323var objectType = this._compilation.GetSpecialType(SpecialType.System_Object);
325RoslynDebug.Assert(getLengthProperty.Type.SpecialType == SpecialType.System_Int32);
339var lengthTemp = new BoundDagTemp(syntax, this._compilation.GetSpecialType(SpecialType.System_Int32), lengthEvaluation);
461if (input.Type.IsDynamic() ? type.SpecialType == SpecialType.System_Object : conversion.IsImplicit)
1515case (SpecialType.System_SByte, SpecialType.System_Byte):
1516case (SpecialType.System_Byte, SpecialType.System_SByte):
1517case (SpecialType.System_Int16, SpecialType.System_UInt16):
1518case (SpecialType.System_UInt16, SpecialType.System_Int16):
1519case (SpecialType.System_Int32, SpecialType.System_UInt32):
1520case (SpecialType.System_UInt32, SpecialType.System_Int32):
1521case (SpecialType.System_Int64, SpecialType.System_UInt64):
1522case (SpecialType.System_UInt64, SpecialType.System_Int64):
1523case (SpecialType.System_IntPtr, SpecialType.System_UIntPtr):
1524case (SpecialType.System_UIntPtr, SpecialType.System_IntPtr):
1529case (SpecialType.System_Int32, SpecialType.System_IntPtr):
1530case (SpecialType.System_Int32, SpecialType.System_UIntPtr):
1531case (SpecialType.System_UInt32, SpecialType.System_IntPtr):
1532case (SpecialType.System_UInt32, SpecialType.System_UIntPtr):
1533case (SpecialType.System_IntPtr, SpecialType.System_Int32):
1534case (SpecialType.System_IntPtr, SpecialType.System_UInt32):
1535case (SpecialType.System_UIntPtr, SpecialType.System_Int32):
1536case (SpecialType.System_UIntPtr, SpecialType.System_UInt32):
1541case (SpecialType.System_Int64, SpecialType.System_IntPtr):
1542case (SpecialType.System_Int64, SpecialType.System_UIntPtr):
1543case (SpecialType.System_UInt64, SpecialType.System_IntPtr):
1544case (SpecialType.System_UInt64, SpecialType.System_UIntPtr):
1545case (SpecialType.System_IntPtr, SpecialType.System_Int64):
1546case (SpecialType.System_IntPtr, SpecialType.System_UInt64):
1547case (SpecialType.System_UIntPtr, SpecialType.System_Int64):
1548case (SpecialType.System_UIntPtr, SpecialType.System_UInt64):
Binder\ForEachLoopBinder.cs (22)
243if (!hasErrors && awaitInfo.GetResult?.ReturnType.SpecialType != SpecialType.System_Boolean)
572(collectionConversionClassification.Kind == ConversionKind.ExplicitReference && collectionExpr.Type.SpecialType == SpecialType.System_String));
629else if (collectionExpr.Type.SpecialType == SpecialType.System_String && builder.CollectionType.SpecialType == SpecialType.System_Collections_IEnumerable)
635inferredType = TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, collectionExpr.Syntax));
826if (!isAsync && collectionExprType.SpecialType == SpecialType.System_String)
888this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T));
920Debug.Assert(collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T);
983Debug.Assert(collectionType.SpecialType == SpecialType.System_Collections_IEnumerable);
988builder.ElementTypeWithAnnotations = builder.CurrentPropertyGetter?.ReturnTypeWithAnnotations ?? TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Object, diagnostics, errorLocationSyntax));
991builder.GetEnumeratorInfo.Method.ReturnType.SpecialType == SpecialType.System_Collections_IEnumerator);
1063isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable),
1076builder.CollectionType = GetSpecialType(SpecialType.System_Collections_IEnumerable, diagnostics, _syntax);
1083GetSpecialType(SpecialType.System_Object, diagnostics, _syntax));
1087builder.ElementTypeWithAnnotations = collectionExprType.SpecialType == SpecialType.System_String ?
1088TypeWithAnnotations.Create(GetSpecialType(SpecialType.System_Char, diagnostics, _syntax)) :
1100TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1498return moveNextMethodCandidate.OriginalDefinition.ReturnType.SpecialType != SpecialType.System_Boolean;
1516case SpecialType.System_Collections_IEnumerable:
1517case SpecialType.System_Collections_Generic_IEnumerable_T:
1557var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable);
1630return 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\Operators\BinaryOperatorOverloadResolution.cs (27)
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);
478var nullable = Compilation.GetSpecialType(SpecialType.System_Nullable_T);
528var boolean = Compilation.GetSpecialType(SpecialType.System_Boolean);
552operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
553operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndUIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
554operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndLongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
555operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndULongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
556operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.IntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType, pointerType));
557operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.UIntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType, pointerType));
558operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.LongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType, pointerType));
559operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.ULongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType, pointerType));
562operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
563operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndUIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
564operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndLongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
565operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerAndULongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
566operators.Add(new BinaryOperatorSignature(BinaryOperatorKind.PointerSubtraction, pointerType, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64)));
583var voidPointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(Compilation.GetSpecialType(SpecialType.System_Void)));
584operators.Add(new BinaryOperatorSignature(kind | BinaryOperatorKind.Pointer, voidPointerType, voidPointerType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
750((object)left.Type == null || (!left.Type.IsDelegateType() && left.Type.SpecialType != SpecialType.System_String && left.Type.SpecialType != SpecialType.System_Delegate)) &&
751((object)right.Type == null || (!right.Type.IsDelegateType() && right.Type.SpecialType != SpecialType.System_String && right.Type.SpecialType != SpecialType.System_Delegate));
762var @object = Compilation.GetSpecialType(SpecialType.System_Object);
763operators.Add(new BinaryOperatorSignature(kind | BinaryOperatorKind.Object, @object, @object, Compilation.GetSpecialType(SpecialType.System_Boolean)));
1023return result.SpecialType == SpecialType.System_Boolean ?
CodeGen\EmitStatement.cs (8)
1025_module.GetSpecialType(SpecialType.System_Object, catchBlock.Syntax, _diagnostics.DiagnosticBag);
1283expression.Type.SpecialType == SpecialType.System_String || expression.Type.IsSpanOrReadOnlySpanChar());
1286if (expression.Type.SpecialType == SpecialType.System_String || expression.Type.IsSpanOrReadOnlySpanChar())
1368var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode, _diagnostics);
1393var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics);
1495var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode, _diagnostics);
1516var sequenceEqualsCharMethod = sequenceEqualsTMethod.Construct(Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics));
1776? _module.GetSpecialType(SpecialType.System_IntPtr, syntaxNode, _diagnostics.DiagnosticBag)
Emitter\Model\PEModuleBuilder.cs (17)
795private NamedTypeSymbol GetUntranslatedSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
812internal sealed override Cci.INamedTypeReference GetSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
835return namedType.SpecialType == (SpecialType)platformType;
1065if ((object)declaredBase != null && declaredBase.SpecialType == SpecialType.System_ValueType)
1499return GetSpecialType(SpecialType.System_Object, syntaxNodeOpt, diagnostics);
1544return new SynthesizedPrivateImplementationDetailsStaticConstructor(SourceModule, details, GetUntranslatedSpecialType(SpecialType.System_Void, syntaxOpt, diagnostics)).GetCciAdapter();
1613NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte);
1634NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte);
1657ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value)));
1697NamedTypeSymbol booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean);
1839TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1840TypeSymbol argumentType = factory.SpecialType(SpecialType.System_Object);
1841TypeSymbol paramNameType = factory.SpecialType(SpecialType.System_String);
1869TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1870TypeSymbol unmatchedValueType = factory.SpecialType(SpecialType.System_Object);
1890TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
1915TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
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 (114)
90Debug.Assert(byteType.SpecialType == SpecialType.System_Byte);
138Debug.Assert(byteArray.ElementType.SpecialType == SpecialType.System_Byte);
221if (type.SpecialType != SpecialType.System_Double && type.SpecialType != SpecialType.System_Single)
425if (rewrittenType.SpecialType == SpecialType.System_Decimal || rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
488if (rewrittenType.SpecialType == SpecialType.System_Decimal)
495else if (rewrittenOperand.Type.SpecialType == SpecialType.System_Decimal)
620SpecialType GetUnderlyingSpecialType(TypeSymbol type) =>
623bool IsInRange(SpecialType type, SpecialType low, SpecialType high) =>
626SpecialType sourceST = GetUnderlyingSpecialType(source);
627SpecialType targetST = GetUnderlyingSpecialType(target);
632IsInRange(sourceST, SpecialType.System_Char, SpecialType.System_Double) &&
633IsInRange(targetST, SpecialType.System_Char, SpecialType.System_UInt64);
679rewrittenOperand.Type.SpecialType != SpecialType.System_Decimal &&
680rewrittenOperand.Type.SpecialType != SpecialType.System_DateTime)
964if (!TypeSymbol.Equals(typeFrom, typeTo, TypeCompareKind.ConsiderEverything2) && (typeFrom.SpecialType == SpecialType.System_Decimal || typeTo.SpecialType == SpecialType.System_Decimal))
1390SpecialType t0Type = t0.IsEnumType() ? t0.GetEnumUnderlyingType()!.SpecialType : t0.SpecialType;
1391SpecialType s0Type = s0.IsEnumType() ? s0.GetEnumUnderlyingType()!.SpecialType : s0.SpecialType;
1393if (t0Type == SpecialType.System_IntPtr)
1402case SpecialType.System_Byte:
1403case SpecialType.System_SByte:
1404case SpecialType.System_Int16:
1405case SpecialType.System_UInt16:
1406case SpecialType.System_Char:
1407case SpecialType.System_Int32:
1409case SpecialType.System_UInt32:
1410case SpecialType.System_UInt64:
1411case SpecialType.System_Int64:
1412case SpecialType.System_Single:
1413case SpecialType.System_Double:
1414case SpecialType.System_Decimal:
1418else if (t0Type == SpecialType.System_UIntPtr)
1427case SpecialType.System_Byte:
1428case SpecialType.System_UInt16:
1429case SpecialType.System_Char:
1430case SpecialType.System_UInt32:
1432case SpecialType.System_SByte:
1433case SpecialType.System_Int16:
1434case SpecialType.System_Int32:
1435case SpecialType.System_UInt64:
1436case SpecialType.System_Int64:
1437case SpecialType.System_Single:
1438case SpecialType.System_Double:
1439case SpecialType.System_Decimal:
1443else if (s0Type == SpecialType.System_IntPtr)
1452case SpecialType.System_Byte:
1453case SpecialType.System_SByte:
1454case SpecialType.System_Int16:
1455case SpecialType.System_UInt16:
1456case SpecialType.System_Char:
1457case SpecialType.System_UInt32:
1458case SpecialType.System_Int32:
1460case SpecialType.System_UInt64:
1461case SpecialType.System_Int64:
1462case SpecialType.System_Single:
1463case SpecialType.System_Double:
1464case SpecialType.System_Decimal:
1468else if (s0Type == SpecialType.System_UIntPtr)
1477case SpecialType.System_SByte:
1478case SpecialType.System_Int16:
1479case SpecialType.System_Int32:
1480case SpecialType.System_Byte:
1481case SpecialType.System_UInt16:
1482case SpecialType.System_Char:
1483case SpecialType.System_UInt32:
1485case SpecialType.System_UInt64:
1486case SpecialType.System_Int64:
1487case SpecialType.System_Single:
1488case SpecialType.System_Double:
1489case SpecialType.System_Decimal:
1500if (typeFrom.SpecialType == SpecialType.System_Decimal)
1505case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Explicit_ToChar;
1506case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Explicit_ToSByte;
1507case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Explicit_ToByte;
1508case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Explicit_ToInt16;
1509case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Explicit_ToUInt16;
1510case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Explicit_ToInt32;
1511case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Explicit_ToUInt32;
1512case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Explicit_ToInt64;
1513case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Explicit_ToUInt64;
1514case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_ToSingle;
1515case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_ToDouble;
1525case SpecialType.System_Char: return SpecialMember.System_Decimal__op_Implicit_FromChar;
1526case SpecialType.System_SByte: return SpecialMember.System_Decimal__op_Implicit_FromSByte;
1527case SpecialType.System_Byte: return SpecialMember.System_Decimal__op_Implicit_FromByte;
1528case SpecialType.System_Int16: return SpecialMember.System_Decimal__op_Implicit_FromInt16;
1529case SpecialType.System_UInt16: return SpecialMember.System_Decimal__op_Implicit_FromUInt16;
1530case SpecialType.System_Int32: return SpecialMember.System_Decimal__op_Implicit_FromInt32;
1531case SpecialType.System_UInt32: return SpecialMember.System_Decimal__op_Implicit_FromUInt32;
1532case SpecialType.System_Int64: return SpecialMember.System_Decimal__op_Implicit_FromInt64;
1533case SpecialType.System_UInt64: return SpecialMember.System_Decimal__op_Implicit_FromUInt64;
1534case SpecialType.System_Single: return SpecialMember.System_Decimal__op_Explicit_FromSingle;
1535case SpecialType.System_Double: return SpecialMember.System_Decimal__op_Explicit_FromDouble;
1544Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal);
1546if (fromType.SpecialType == SpecialType.System_Decimal)
1550case SpecialType.System_IntPtr:
1551case SpecialType.System_UIntPtr:
1552operand = RewriteDecimalConversionCore(syntax, operand, fromType, get64BitType(_compilation, signed: toType.SpecialType == SpecialType.System_IntPtr), isImplicit, constantValueOpt);
1560case SpecialType.System_IntPtr:
1561case SpecialType.System_UIntPtr:
1562operand = MakeConversionNode(operand, get64BitType(_compilation, signed: fromType.SpecialType == SpecialType.System_IntPtr), @checked);
1570static TypeSymbol get64BitType(CSharpCompilation compilation, bool signed) => compilation.GetSpecialType(signed ? SpecialType.System_Int64 : SpecialType.System_UInt64);
1650if (fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal)
1665if (fromType.SpecialType == SpecialType.System_Decimal)
1678else 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 (38)
335public NamedTypeSymbol SpecialType(SpecialType st)
613return new BoundIsOperator(this.Syntax, operand, Type(type), c.Kind, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
618Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
619Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
620return Binary(BinaryOperatorKind.LogicalBoolAnd, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
625Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
626Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
627return Binary(BinaryOperatorKind.LogicalBoolOr, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
632return Binary(BinaryOperatorKind.IntEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
637return Binary(BinaryOperatorKind.ObjectEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
642return Binary(BinaryOperatorKind.ObjectNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
647return Binary(BinaryOperatorKind.IntNotEqual, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
652return Binary(BinaryOperatorKind.IntLessThan, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right);
657return Binary(BinaryOperatorKind.IntGreaterThanOrEqual, SpecialType(CodeAnalysis.SpecialType.System_Boolean), left, right);
662return Binary(BinaryOperatorKind.IntSubtraction, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
667return Binary(BinaryOperatorKind.IntMultiplication, SpecialType(CodeAnalysis.SpecialType.System_Int32), left, right);
672return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Byte)) { WasCompilerGenerated = true };
677return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
685return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt32)) { WasCompilerGenerated = true };
721case { SpecialType: CodeAnalysis.SpecialType.System_Double }:
724case { SpecialType: CodeAnalysis.SpecialType.System_Single }:
1002Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 });
1064return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true };
1076return new BoundLiteral(Syntax, stringConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1087return new BoundLiteral(Syntax, charConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Char)) { WasCompilerGenerated = true };
1098return new BoundArrayLength(Syntax, array, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32));
1213return new BoundSizeOfOperator(Syntax, Type(type), Binder.GetConstantSizeOf(type), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
1231SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1241SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1251SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1259SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt64))
1274return new BoundModuleVersionIdString(Syntax, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true };
1286SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1298SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1498Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } });
1631TypeSymbol boolType = Compilation.GetSpecialType(CodeAnalysis.SpecialType.System_Boolean);
1645TypeSymbol objectType = SpecialType(CodeAnalysis.SpecialType.System_Object);
1694Debug.Assert(returnType.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
Symbols\Source\SourceDelegateMethodSymbol.cs (7)
56var voidType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax));
58var objectType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax));
59var intPtrType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax));
76if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error &&
77binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
81var iAsyncResultType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax));
82var asyncCallbackType = TypeWithAnnotations.Create(binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax));
Symbols\Source\SourceNamedTypeSymbol.cs (10)
941string? name = attributeData.GetConstructorArgument<string>(0, SpecialType.System_String);
1016Debug.Assert(this.SpecialType == SpecialType.System_Object || this.DeclaringCompilation.IsAttributeType(this));
1298string name = attribute.GetConstructorArgument<string>(0, SpecialType.System_String);
1488if ((object)baseType != null && baseType.SpecialType != SpecialType.System_Object)
1580new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, PEModule.ByRefLikeMarker), // message
1581new TypedConstant(compilation.GetSpecialType(SpecialType.System_Boolean), TypedConstantKind.Primitive, true)), // error=true
1586ImmutableArray.Create(new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, nameof(CompilerFeatureRequiredFeatures.RefStructs))),
1599var defaultMemberNameConstant = new TypedConstant(compilation.GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, defaultMemberName);
1644Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr);
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (4)
44_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Void, NoLocation.Singleton, diagnostics);
48Construct(Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics));
51_returnType = Binder.GetSpecialType(compilation, SpecialType.System_Int32, NoLocation.Singleton, diagnostics);
67TypeWithAnnotations.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,
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (10)
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)
95SpecialType.System_Byte => IsUnsignedBoundary(startValue, endValue, byte.MaxValue),
96SpecialType.System_UInt16 => IsUnsignedBoundary(startValue, endValue, ushort.MaxValue),
97SpecialType.System_UInt32 => IsUnsignedBoundary(startValue, endValue, uint.MaxValue),
98SpecialType.System_UInt64 => IsUnsignedBoundary(startValue, endValue, ulong.MaxValue),
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 (38)
531expressionType = GetSpecialType(SpecialType.System_Object, expression.Syntax, diagnostics)
672If typeSym.IsArrayType AndAlso DirectCast(typeSym, ArrayTypeSymbol).ElementType.SpecialType = SpecialType.System_Void Then
744Return New BoundNameOfOperator(node, argument, ConstantValue.Create(value), GetSpecialType(SpecialType.System_String, node, diagnostics))
757Dim resultType As TypeSymbol = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
782operand = ApplyImplicitConversion(node, GetSpecialType(SpecialType.System_Object, node.Expression, diagnostics), operand, diagnostics)
951resultType = GetSpecialType(SpecialType.System_Nullable_T, expr.Syntax, diagnostics).Construct(resultType)
1237(exprType IsNot Nothing AndAlso exprType.SpecialType = SpecialType.System_Void) Then
1414GetSpecialType(SpecialType.System_Object, expr.Syntax, diagnostics), Nothing)
1514(originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
1515originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IList_T OrElse
1516originalTargetType.SpecialType = SpecialType.System_Collections_Generic_ICollection_T OrElse
1517originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyList_T OrElse
1518originalTargetType.SpecialType = SpecialType.System_Collections_Generic_IReadOnlyCollection_T) Then
1919dominantType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
1986dominantType = If(boundFirstArg.Type, If(boundSecondArg.Type, GetSpecialType(SpecialType.System_Object, node, diagnostics)))
2458MemberLookup.GetTypeForIntrinsicAlias(name) <> SpecialType.None Then
3721GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3738If type.SpecialType = SpecialType.System_Object OrElse type.IsExtensibleInterfaceNoUseSiteDiagnostics() Then
3740Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3759Dim arg = New BoundLiteral(name, ConstantValue.Create(node.Name.Identifier.ValueText), GetSpecialType(SpecialType.System_String, name, diagnostics))
3776If type.SpecialType = SpecialType.System_Array Then
3802GetSpecialType(SpecialType.System_String, node.Name, diagnostics))),
3845Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3847If specialType <> Microsoft.CodeAnalysis.SpecialType.None Then
3868Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(typeChar, typeCharacterString)
3870If specialType <> specialType.None Then
3892Dim int32Type = GetSpecialType(SpecialType.System_Int32, node.ArgumentList, diagnostics)
4103Dim Int32Type = GetSpecialType(SpecialType.System_Int32, node, diagnostics)
4187inferredElementType = GetSpecialType(SpecialType.System_Object, node, diagnostics)
4319Dim int32Type = GetSpecialType(SpecialType.System_Int32, arrayBoundsOpt, diagnostics)
4434Dim specialType As SpecialType = SpecialTypeExtensions.FromRuntimeTypeOfLiteralValue(value)
4437Debug.Assert(specialType <> specialType.None AndAlso
4438specialType <> specialType.System_Byte AndAlso
4439specialType <> specialType.System_SByte)
4573Debug.Assert(dominantType.IsArrayType AndAlso DirectCast(dominantType, ArrayTypeSymbol).Rank = 1 AndAlso DirectCast(dominantType, ArrayTypeSymbol).ElementType.SpecialType = SpecialType.System_Object)
4579dominantType = GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
4584dominantType = GetSpecialType(SpecialType.System_Object, syntax, diagnostics)
4898resultType = GetSpecialType(SpecialType.System_Void, node, diagnostics)
Binding\Binder_Invocation.vb (10)
338If target.Type.SpecialType = SpecialType.System_Object OrElse
339target.Type.SpecialType = SpecialType.System_Array Then
2725GetSpecialType(SpecialType.System_Int32, node, diagnostics)).MakeCompilerGenerated()}).AsImmutableOrNull(),
3184literal = New BoundLiteral(syntax, callerInfoValue, GetSpecialType(SpecialType.System_Int32, syntax, ignoreDiagnostics))
3187literal = New BoundLiteral(syntax, callerInfoValue, GetSpecialType(SpecialType.System_String, syntax, ignoreDiagnostics))
3225defaultConstantValue = ConstantValue.Default(SpecialType.System_Int32)
3228If paramNullableUnderlyingTypeOrSelf.GetEnumUnderlyingTypeOrSelf().SpecialType = SpecialType.System_Int32 Then
3231defaultArgumentType = GetSpecialType(SpecialType.System_Int32, syntax, diagnostics)
3234ElseIf defaultSpecialType <> SpecialType.None Then
3255If 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 (28)
45Dim booleanType = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
81GetSpecialType(SpecialType.System_Object, targetArgument.Syntax, diagnostics),
104GetSpecialType(SpecialType.System_Object, targetArgument.Syntax, diagnostics),
256Dim intrinsicOperatorType As SpecialType = SpecialType.None
303If intrinsicOperatorType = SpecialType.None Then
342Dim booleanType As TypeSymbol = GetSpecialTypeForBinaryOperator(node, leftType, rightType, SpecialType.System_Boolean,
454Dim rightTargetType As TypeSymbol = GetSpecialTypeForBinaryOperator(node, leftType, rightType, SpecialType.System_Int32,
791stringType = GetSpecialType(SpecialType.System_String, dbNullOperand.Syntax, diagnostics)
809specialType As SpecialType,
813Debug.Assert(specialType <> Microsoft.CodeAnalysis.SpecialType.None)
882If ofSpecialType <> SpecialType.None Then
990Dim defaultRightSpecialType As SpecialType
995defaultRightSpecialType = SpecialType.System_String
999defaultRightSpecialType = SpecialType.System_Boolean
1019defaultRightSpecialType = SpecialType.System_Int32
1038Dim defaultLeftSpecialType As SpecialType = SpecialType.None
1052defaultLeftSpecialType = SpecialType.System_String
1058defaultLeftSpecialType = SpecialType.System_Int32
1061If defaultLeftSpecialType = SpecialType.None OrElse defaultLeftSpecialType = rightType.SpecialType Then
1092If leftType.SpecialType <> SpecialType.System_String Then
1093rightType = GetSpecialType(SpecialType.System_String, right.Syntax, diagnostics)
1113Dim int32Type = GetSpecialType(SpecialType.System_Int32, node.Operand, diagnostics)
1124Dim intrinsicOperatorType As SpecialType = SpecialType.None
1158If intrinsicOperatorType = SpecialType.None Then
1177If 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)
779target.Type.SpecialType <> SpecialType.System_Array AndAlso
780target.Type.SpecialType <> SpecialType.System_Object Then
1336If hasExplicitType AndAlso Not (symbol.IsConst AndAlso type.SpecialType = SpecialType.System_Object) Then
2178Dim int32 As NamedTypeSymbol = GetSpecialType(SpecialType.System_Int32, midExpression, diagnostics)
2190Dim stringType As NamedTypeSymbol = GetSpecialType(SpecialType.System_String, midExpression, diagnostics)
2235Compilation.GetSpecialType(SpecialType.System_Void),
2422Dim container = If(exprSymbol IsNot Nothing, exprSymbol.ContainingSymbol, Compilation.GetSpecialType(SpecialType.System_Object))
2722GetSpecialType(SpecialType.System_Void, conditionalAccess.Syntax, diagnostics))
3136Me.GetSpecialType(SpecialType.System_Int32, forStatement, diagnostics))
3162Dim integerType = GetSpecialType(SpecialType.System_Int32, node, diagnostics)
3163Dim booleanType = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
3459Dim idisposableType = Compilation.GetSpecialType(SpecialType.System_IDisposable)
3475Debug.Assert(enumeratorType.SpecialType = SpecialType.System_Collections_IEnumerator)
3720Dim interfaceSpecialType As SpecialType = SpecialType.None
3742Dim genericIEnumerable = GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T, collectionSyntax, ienumerableUseSiteDiagnostics)
3777interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T
3782Dim ienumerable = GetSpecialType(SpecialType.System_Collections_IEnumerable, collectionSyntax, ienumerableUseSiteDiagnostics)
3792interfaceSpecialType = SpecialType.System_Collections_IEnumerable
3843If interfaceSpecialType <> SpecialType.None Then
3850If interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T Then
3910If interfaceSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T Then
3954elementType = GetSpecialType(SpecialType.System_Char, collectionSyntax, diagnostics)
3960Dim idisposable = GetSpecialType(SpecialType.System_IDisposable, collectionSyntax, diagnostics)
3974getEnumeratorReturnType.SpecialType = SpecialType.System_Collections_IEnumerator Then
4136DirectCast(boundMoveNextCall, BoundCall).Method.OriginalDefinition.ReturnType.SpecialType <> SpecialType.System_Boolean Then
4326Dim valueTypeSymbol = interfaceType.ContainingAssembly.GetSpecialType(SpecialType.System_ValueType)
4417Dim iDisposable = GetSpecialType(SpecialType.System_IDisposable,
4921Dim boolSymbol As NamedTypeSymbol = GetSpecialType(SpecialType.System_Boolean, node, diagnostics)
4948Return Compilation.GetSpecialType(SpecialType.System_Void)
4952Return Compilation.GetSpecialType(SpecialType.System_Void)
4986If retType.SpecialType = SpecialType.System_Void Then
4992If(isAsync AndAlso Not methodReturnType.SpecialType = SpecialType.System_Void, ERRID.ERR_ReturnFromNonGenericTaskAsync, ERRID.ERR_ReturnFromNonFunction)))
5076Dim returnSpecialType As SpecialType = If(returnNamedType IsNot Nothing, returnNamedType.SpecialType, Nothing)
5078If returnSpecialType = SpecialType.System_Collections_Generic_IEnumerable_T OrElse
5079returnSpecialType = SpecialType.System_Collections_Generic_IEnumerator_T Then
5084If returnSpecialType = SpecialType.System_Collections_IEnumerable OrElse
5085returnSpecialType = SpecialType.System_Collections_IEnumerator Then
5087Return GetSpecialType(SpecialType.System_Object, node, diagnostics)
5205GetSpecialType(SpecialType.System_Int32, node.ErrorNumber, diagnostics),
Binding\Binder_Utils.vb (35)
295Dim nullableType As NamedTypeSymbol = DirectCast(GetSpecialType(SpecialType.System_Nullable_T, syntax, diagBag), NamedTypeSymbol)
673Dim specialType As SpecialType = GetSpecialTypeForTypeCharacter(identifier.GetTypeCharacter(), typeCharacterString)
675If specialType <> Microsoft.CodeAnalysis.SpecialType.None Then
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)
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Spilling.vb (21)
453Case SpecialType.System_Void,
454SpecialType.System_Boolean,
455SpecialType.System_Char,
456SpecialType.System_SByte,
457SpecialType.System_Byte,
458SpecialType.System_Int16,
459SpecialType.System_UInt16,
460SpecialType.System_Int32,
461SpecialType.System_UInt32,
462SpecialType.System_Int64,
463SpecialType.System_UInt64,
464SpecialType.System_Decimal,
465SpecialType.System_Single,
466SpecialType.System_Double,
467SpecialType.System_IntPtr,
468SpecialType.System_UIntPtr,
469SpecialType.System_TypedReference,
470SpecialType.System_ArgIterator,
471SpecialType.System_RuntimeArgumentHandle
474Case SpecialType.System_Object,
475SpecialType.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)
74Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
114Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
203Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
270Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
328Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
345Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
402Me.GetSpecialType(SpecialType.System_Void))
461Me.GetSpecialType(SpecialType.System_Void))
535Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(memberAccess), Nothing, Me.GetSpecialType(SpecialType.System_Void))
540Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(memberAccess), Nothing, Me.GetSpecialType(SpecialType.System_Void))
614Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(invocation), Nothing, Me.GetSpecialType(SpecialType.System_Void))
619Return New BoundSequence(syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(Of BoundExpression)(invocation), Nothing, Me.GetSpecialType(SpecialType.System_Void))
952Dim intType = Me.GetSpecialType(SpecialType.System_Int32)
Lowering\SyntheticBoundNodeFactory.vb (18)
226Public Function SpecialType(st As SpecialType) As NamedTypeSymbol
232Dim nullableType As NamedTypeSymbol = SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Nullable_T)
423Return Binary(BinaryOperatorKind.AndAlso, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right)
427Return Binary(BinaryOperatorKind.OrElse, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right)
431Return Binary(BinaryOperatorKind.Equals, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right)
435Return Binary(BinaryOperatorKind.LessThan, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right)
439Dim boundNode = New BoundLiteral(_syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean))
445Dim boundNode = New BoundLiteral(_syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
758Dim boundNode = New BoundLiteral(_syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String))
765Dim boundNode = New BoundLiteral(_syntax, value, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String))
928Dim boundNode As New BoundMethodDefIndex(Syntax, method, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
937Dim boundNode As New BoundMaximumMethodDefIndex(Syntax, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
955Dim boundNode As New BoundModuleVersionIdString(Syntax, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String))
975Dim boundNode As New BoundSourceDocumentIndex(Syntax, document, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
1032Dim boundNode = Binary(BinaryOperatorKind.Is, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), left, right)
1039Dim boundNode = Binary(BinaryOperatorKind.Is, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), operand, Me.Null(operand.Type))
1046Dim boundNode = Binary(BinaryOperatorKind.IsNot, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean), operand, Me.Null(operand.Type))
1103Me.SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Void),
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 (100)
359If method.Parameters(1).Type.GetNullableUnderlyingTypeOrSelf().SpecialType <> Microsoft.CodeAnalysis.SpecialType.System_Int32 Then
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\MissingMetadataTypeSymbol.vb (13)
55Dim arg = If(Me.SpecialType <> SpecialType.None, DirectCast(CustomSymbolDisplayFormatter.DefaultErrorFormat(Me), Object), Me)
99Public Sub New([module] As ModuleSymbol, ByRef fullname As MetadataTypeName, Optional typeId As SpecialType = CType(-1, SpecialType))
101Debug.Assert(typeId = CType(-1, SpecialType) OrElse typeId = SpecialType.None OrElse Arity = 0 OrElse MangleName)
177Public Overrides ReadOnly Property SpecialType As SpecialType
180Dim typeId As SpecialType = SpecialType.None
193Return CType(_lazyTypeId, SpecialType)
233Public Sub New(moduleSymbol As ModuleSymbol, ByRef emittedName As MetadataTypeName, errorInfo As DiagnosticInfo, Optional typeId As SpecialType = CType(-1, SpecialType))
287Public Overrides ReadOnly Property SpecialType As SpecialType
289Return SpecialType.None ' do not have nested types among CORE types yet.
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 (26)
34Private ReadOnly _corTypeId As SpecialType
91_corTypeId = SpecialType.None
100Public Overrides ReadOnly Property SpecialType As SpecialType
1252Private Function IsRestrictedBaseClass(type As SpecialType) As Boolean
1254Case SpecialType.System_Array,
1255SpecialType.System_Delegate,
1256SpecialType.System_MulticastDelegate,
1257SpecialType.System_Enum,
1258SpecialType.System_ValueType
1372If declaredOrDefaultBase Is Nothing AndAlso Me.SpecialType <> Microsoft.CodeAnalysis.SpecialType.System_Object Then
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)
1412Private Function GetSpecialType(type As SpecialType) As NamedTypeSymbol
1502Return GetSpecialType(SpecialType.System_Enum)
1505Return GetSpecialType(SpecialType.System_MulticastDelegate)
1788Return bodyBinder.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32, syntax.EnumStatement.Identifier, diagnostics)
2035Dim conditionalSymbol As String = attrdata.GetConstructorArgument(Of String)(0, SpecialType.System_String)
2127Debug.Assert(Me.IsOrDerivedFromWellKnownClass(WellKnownType.System_Attribute, DeclaringCompilation, CompoundUseSiteInfo(Of AssemblySymbol).Discarded) OrElse Me.SpecialType = Microsoft.CodeAnalysis.SpecialType.System_Object)
2474Dim stringType = GetSpecialType(SpecialType.System_String)
2496New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, _comClassData.ClassId))))
2502New TypedConstant(GetSpecialType(SpecialType.System_Int32), TypedConstantKind.Enum, CInt(ClassInterfaceType.None)))))
2523New TypedConstant(GetSpecialType(SpecialType.System_String), TypedConstantKind.Primitive, eventInterfaceName))))
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (4)
29Dim baseTypeNames() As String = If(attributeData.GetConstructorArgument(Of String)(0, SpecialType.System_String), "").Split(separatorComma, StringSplitOptions.None)
30Dim createMethods() As String = If(attributeData.GetConstructorArgument(Of String)(1, SpecialType.System_String), "").Split(separatorComma, StringSplitOptions.None)
31Dim disposeMethods() As String = If(attributeData.GetConstructorArgument(Of String)(2, SpecialType.System_String), "").Split(separatorComma, StringSplitOptions.None)
37defaultInstances = If(attributeData.GetConstructorArgument(Of String)(3, Microsoft.CodeAnalysis.SpecialType.System_String), "").Split(separatorComma, StringSplitOptions.None)
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
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (8)