103 references to InternalSpecialType
Microsoft.CodeAnalysis (46)
ExtendedSpecialType.cs (16)
11
/// A structure meant to represent a union of <see cref="SpecialType"/> and <see cref="
InternalSpecialType
"/> values
26
public static explicit operator SpecialType(ExtendedSpecialType value) => value._value < (int)
InternalSpecialType
.First ? (SpecialType)value._value : SpecialType.None;
28
public static implicit operator ExtendedSpecialType(
InternalSpecialType
value) => new ExtendedSpecialType((int)value);
29
public static explicit operator
InternalSpecialType
(ExtendedSpecialType value) => value._value is < (int)
InternalSpecialType
.First or >= (int)
InternalSpecialType
.NextAvailable ?
InternalSpecialType
.Unknown : (
InternalSpecialType
)value._value;
47
case
InternalSpecialType
other:
72
Debug.Assert(
InternalSpecialType
.First ==
InternalSpecialType
.System_ReadOnlySpan_T);
73
if (_value == (int)
InternalSpecialType
.System_ReadOnlySpan_T)
75
return nameof(
InternalSpecialType
.System_ReadOnlySpan_T);
78
if (_value > (int)
InternalSpecialType
.First && _value < (int)
InternalSpecialType
.NextAvailable)
80
return ((
InternalSpecialType
)_value).ToString();
MemberDescriptor.cs (2)
50
public bool IsSpecialTypeMember => _declaringTypeId < (int)
InternalSpecialType
.NextAvailable;
56
Debug.Assert(_declaringTypeId < (int)
InternalSpecialType
.NextAvailable);
SpecialMembers.cs (24)
106
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
109
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
119
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
122
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
125
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
135
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
138
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
141
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
144
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
196
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_IFormatProvider,
214
(byte)SignatureTypeCode.GenericTypeInstance, (byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_ReadOnlySpan_T,
277
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Type,
279
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Reflection_MethodInfo,
287
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Type,
289
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Reflection_MethodInfo,
1161
(byte)
InternalSpecialType
.System_ReadOnlySpan_T, // DeclaringTypeId
1271
(byte)
InternalSpecialType
.System_Reflection_MethodBase, // DeclaringTypeId
1274
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Reflection_MethodBase, // Return Type
1279
(byte)
InternalSpecialType
.System_Reflection_MethodBase, // DeclaringTypeId
1282
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Reflection_MethodBase, // Return Type
1311
(byte)
InternalSpecialType
.System_Type, // DeclaringTypeId
1314
(byte)SignatureTypeCode.TypeHandle, (byte)
InternalSpecialType
.System_Type, // Return Type
1319
(byte)
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers, // DeclaringTypeId
1327
(byte)
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers, // DeclaringTypeId
SpecialTypes.cs (2)
19
private static readonly string?[] s_emittedNames = new string?[(int)
InternalSpecialType
.NextAvailable]
93
s_nameToTypeIdMap = new Dictionary<string, ExtendedSpecialType>((int)
InternalSpecialType
.NextAvailable - 1);
WellKnownTypes.cs (2)
21
First =
InternalSpecialType
.NextAvailable,
762
const int ExpectedCSharp7SentinelValue = 200 + (int)
InternalSpecialType
.NextAvailable + 1 /* Placeholder for ExtSentinel */;
Microsoft.CodeAnalysis.CSharp (30)
Binder\Binder_Await.cs (2)
337
var asyncHelpersType = GetSpecialType(
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers, diagnostics, expression.Syntax);
481
Compilation.GetSpecialType(
InternalSpecialType
.System_Runtime_CompilerServices_ICriticalNotifyCompletion),
BoundTree\BoundAwaitableInfo.cs (1)
15
Debug.Assert(RuntimeAsyncAwaitCall.Method.ContainingType.ExtendedSpecialType ==
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers);
CodeGen\CodeGenerator.cs (6)
181
Debug.Assert(((
InternalSpecialType
)returnType.OriginalDefinition.ExtendedSpecialType) is
InternalSpecialType
.System_Threading_Tasks_ValueTask_T or
InternalSpecialType
.System_Threading_Tasks_Task_T);
327
&& ((
InternalSpecialType
)_method.ReturnType.ExtendedSpecialType) is
InternalSpecialType
.System_Threading_Tasks_Task or
InternalSpecialType
.System_Threading_Tasks_ValueTask));
Compilation\CSharpCompilation.cs (6)
334
if (((
InternalSpecialType
)methodReturn.ExtendedSpecialType) is not (
335
InternalSpecialType
.System_Threading_Tasks_Task or
336
InternalSpecialType
.System_Threading_Tasks_Task_T or
337
InternalSpecialType
.System_Threading_Tasks_ValueTask or
338
InternalSpecialType
.System_Threading_Tasks_ValueTask_T))
1699
if ((int)specialType <= (int)SpecialType.None || (int)specialType >= (int)
InternalSpecialType
.NextAvailable)
Lowering\AsyncRewriter\RuntimeAsyncRewriter.cs (1)
83
_factory.Compilation.GetSpecialType(
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers)));
Lowering\LocalRewriter\LocalRewriter.cs (2)
648
Debug.Assert(node.Type.ExtendedSpecialType ==
InternalSpecialType
.System_Type ||
660
if (node.Type.ExtendedSpecialType ==
InternalSpecialType
.System_Type)
Lowering\SyntheticBoundNodeFactory.cs (4)
1268
Debug.Assert(systemType.ExtendedSpecialType ==
InternalSpecialType
.System_Type ||
1273
if (systemType.ExtendedSpecialType ==
InternalSpecialType
.System_Type)
1450
Debug.Assert(systemReflectionMethodOrConstructorInfo.ExtendedSpecialType ==
InternalSpecialType
.System_Reflection_MethodInfo ||
1456
if (systemReflectionMethodOrConstructorInfo.ExtendedSpecialType ==
InternalSpecialType
.System_Reflection_MethodInfo)
Symbols\AssemblySymbol.cs (1)
502
=> GetSpecialType(
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers) is { TypeKind: TypeKind.Class, IsStatic: true };
Symbols\MetadataOrSourceAssemblySymbol.cs (3)
91
new NamedTypeSymbol[(int)
InternalSpecialType
.NextAvailable], null);
103
Debug.Assert(_cachedSpecialTypes > 0 && _cachedSpecialTypes < (int)
InternalSpecialType
.NextAvailable);
115
return ReferenceEquals(this.CorLibrary, this) && _cachedSpecialTypes < (int)
InternalSpecialType
.NextAvailable - 1;
Symbols\MissingCorLibrarySymbol.cs (1)
72
new NamedTypeSymbol[(int)
InternalSpecialType
.NextAvailable], null);
Symbols\MissingMetadataTypeSymbol.cs (1)
149
/// Either <see cref="SpecialType"/>, <see cref="
InternalSpecialType
"/>, <see cref="WellKnownType"/>, or -1 if not initialized.
Symbols\Source\SourceMemberContainerSymbol.cs (2)
112
_ = new int[SpecialTypeMask - (int)
InternalSpecialType
.NextAvailable + 1];
114
Debug.Assert(EnumUtilities.ContainsAllValues<
InternalSpecialType
>(SpecialTypeMask)); //This assert might false fail in the future, we don't really need to be able to represent NextAvailable
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenAsyncTests.cs (2)
8938
comp.MakeTypeMissing(
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers);
8947
comp.MakeTypeMissing(
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (20)
Symbols\CorLibrary\CorTypes.cs (18)
63
var knownMissingInternalSpecialTypes = new HashSet<
InternalSpecialType
>()
65
InternalSpecialType
.System_Runtime_CompilerServices_AsyncHelpers,
86
for (int i = (int)
InternalSpecialType
.First; i < (int)
InternalSpecialType
.NextAvailable; i++)
88
var
internalSpecialType = (
InternalSpecialType
)i;
168
for (int i = (int)
InternalSpecialType
.First; i < (int)
InternalSpecialType
.NextAvailable; i++)
171
var t = msCorLibRef.GetSpecialType((
InternalSpecialType
)i);
214
for (int i = (int)
InternalSpecialType
.First; i < (int)
InternalSpecialType
.NextAvailable; i++)
217
var t = c1.GetSpecialType((
InternalSpecialType
)i);
237
Assert.Throws<ArgumentOutOfRangeException>(() => c1.GetSpecialType(
InternalSpecialType
.NextAvailable));
298
Assert.False(comp.GetSpecialType(
InternalSpecialType
.System_Type).IsErrorType());
304
Assert.Equal(
InternalSpecialType
.System_Type, model.GetTypeInfo(node).Type.GetSymbol().ExtendedSpecialType);
362
Assert.True(comp1.GetSpecialType(
InternalSpecialType
.System_Type).IsErrorType());
435
Assert.False(comp.GetSpecialType(
InternalSpecialType
.System_Type).IsErrorType());
543
Assert.True(comp1.GetSpecialType(
InternalSpecialType
.System_Type).IsErrorType());
Symbols\Metadata\PE\LoadingFields.cs (2)
150
var readOnlySpanType = comp.GetSpecialType(
InternalSpecialType
.System_ReadOnlySpan_T);
153
Assert.Equal((ExtendedSpecialType)
InternalSpecialType
.System_ReadOnlySpan_T, readOnlySpanType.ExtendedSpecialType);
Microsoft.CodeAnalysis.UnitTests (5)
CorLibTypesTests.cs (1)
20
for (int i = 1; i < (int)
InternalSpecialType
.NextAvailable; i++)
Symbols\SpecialTypeTests.cs (4)
18
AssertEx.Equal("System_ReadOnlySpan_T", ((ExtendedSpecialType)
InternalSpecialType
.First).ToString());
19
AssertEx.Equal("System_ReadOnlySpan_T", ((ExtendedSpecialType)
InternalSpecialType
.System_ReadOnlySpan_T).ToString());
20
AssertEx.Equal("System_Runtime_CompilerServices_ICriticalNotifyCompletion", ((ExtendedSpecialType)(
InternalSpecialType
.NextAvailable - 1)).ToString());
21
AssertEx.Equal("58", ((ExtendedSpecialType)
InternalSpecialType
.NextAvailable).ToString());