Class KnownSymbols
Provides a caching layer for common known symbols wrapping a Compilation instance.
public class KnownSymbols
- Inheritance
-
KnownSymbols
- Inherited Members
Constructors
KnownSymbols(Compilation)
Provides a caching layer for common known symbols wrapping a Compilation instance.
public KnownSymbols(Compilation compilation)
Parameters
compilationCompilationThe compilation from which information is being queried.
Properties
Compilation
The compilation from which information is being queried.
public Compilation Compilation { get; }
Property Value
CompilerGeneratedAttribute
The type symbol for CompilerGeneratedAttribute.
public INamedTypeSymbol? CompilerGeneratedAttribute { get; }
Property Value
CoreLibAssembly
The assembly symbol for the core library.
public IAssemblySymbol CoreLibAssembly { get; }
Property Value
DictionaryOfTKeyTValue
The type symbol for Dictionary<TKey, TValue>.
public INamedTypeSymbol? DictionaryOfTKeyTValue { get; }
Property Value
ExceptionType
The type symbol for Exception.
public INamedTypeSymbol? ExceptionType { get; }
Property Value
FSharpList
The type symbol for the F# list type.
public INamedTypeSymbol? FSharpList { get; }
Property Value
FSharpMap
The type symbol for the F# map type.
public INamedTypeSymbol? FSharpMap { get; }
Property Value
FlagsAttribute
The type symbol for FlagsAttribute.
public INamedTypeSymbol? FlagsAttribute { get; }
Property Value
FrozenDictionary
The type symbol for FrozenDictionary.
public INamedTypeSymbol? FrozenDictionary { get; }
Property Value
FrozenSet
The type symbol for FrozenSet.
public INamedTypeSymbol? FrozenSet { get; }
Property Value
HashSetOfT
The type symbol for HashSet<T>.
public INamedTypeSymbol? HashSetOfT { get; }
Property Value
IAsyncEnumerableOfT
The type symbol for IAsyncEnumerable{T}.
public INamedTypeSymbol? IAsyncEnumerableOfT { get; }
Property Value
ICollection
The type symbol for ICollection.
public INamedTypeSymbol? ICollection { get; }
Property Value
ICollectionOfT
The type symbol for ICollection<T>.
public INamedTypeSymbol? ICollectionOfT { get; }
Property Value
IComparerOfT
The type symbol for IComparer<T>.
public INamedTypeSymbol? IComparerOfT { get; }
Property Value
IDictionary
The type symbol for IDictionary.
public INamedTypeSymbol? IDictionary { get; }
Property Value
IDictionaryOfTKeyTValue
The type symbol for IDictionary<TKey, TValue>.
public INamedTypeSymbol? IDictionaryOfTKeyTValue { get; }
Property Value
IEnumerable
The type symbol for IEnumerable.
public INamedTypeSymbol IEnumerable { get; }
Property Value
IEnumerableOfT
The type symbol for IEnumerable<T>.
public INamedTypeSymbol IEnumerableOfT { get; }
Property Value
IEqualityComparerOfT
The type symbol for IEqualityComparer<T>.
public INamedTypeSymbol? IEqualityComparerOfT { get; }
Property Value
IImmutableDictionary
The type symbol for IImmutableDictionary<TKey, TValue>.
public INamedTypeSymbol? IImmutableDictionary { get; }
Property Value
IImmutableSet
The type symbol for IImmutableSet<T>.
public INamedTypeSymbol? IImmutableSet { get; }
Property Value
IImmutableSetOfT
The type symbol for IImmutableSet{T}.
public INamedTypeSymbol? IImmutableSetOfT { get; }
Property Value
IList
The type symbol for IList.
public INamedTypeSymbol? IList { get; }
Property Value
IReadOnlyDictionaryOfTKeyTValue
The type symbol for IReadOnlyDictionary<TKey, TValue>.
public INamedTypeSymbol? IReadOnlyDictionaryOfTKeyTValue { get; }
Property Value
IReadOnlySetOfT
The type symbol for IReadOnlySet{T}.
public INamedTypeSymbol? IReadOnlySetOfT { get; }
Property Value
ISetOfT
The type symbol for ISet<T>.
public INamedTypeSymbol? ISetOfT { get; }
Property Value
ImmutableArray
The type symbol for ImmutableArray<T>.
public INamedTypeSymbol? ImmutableArray { get; }
Property Value
ImmutableDictionary
The type symbol for ImmutableDictionary<TKey, TValue>.
public INamedTypeSymbol? ImmutableDictionary { get; }
Property Value
ImmutableHashSet
The type symbol for ImmutableHashSet<T>.
public INamedTypeSymbol? ImmutableHashSet { get; }
Property Value
ImmutableList
The type symbol for ImmutableList<T>.
public INamedTypeSymbol? ImmutableList { get; }
Property Value
ImmutableQueue
The type symbol for ImmutableQueue<T>.
public INamedTypeSymbol? ImmutableQueue { get; }
Property Value
ImmutableSortedDictionary
The type symbol for ImmutableSortedDictionary<TKey, TValue>.
public INamedTypeSymbol? ImmutableSortedDictionary { get; }
Property Value
ImmutableSortedSet
The type symbol for ImmutableSortedSet<T>.
public INamedTypeSymbol? ImmutableSortedSet { get; }
Property Value
ImmutableStack
The type symbol for ImmutableStack<T>.
public INamedTypeSymbol? ImmutableStack { get; }
Property Value
KeyValuePairOfKV
The type symbol for KeyValuePair<TKey, TValue>.
public INamedTypeSymbol? KeyValuePairOfKV { get; }
Property Value
ListOfT
The type symbol for List<T>.
public INamedTypeSymbol? ListOfT { get; }
Property Value
MemberInfoType
The type symbol for MemberInfo.
public INamedTypeSymbol? MemberInfoType { get; }
Property Value
MemoryOfT
The type symbol for Memory<T>.
public INamedTypeSymbol? MemoryOfT { get; }
Property Value
ReadOnlyMemoryOfT
The type symbol for ReadOnlyMemory<T>.
public INamedTypeSymbol? ReadOnlyMemoryOfT { get; }
Property Value
ReadOnlySpanOfT
The type symbol for ReadOnlySpan<T>.
public INamedTypeSymbol? ReadOnlySpanOfT { get; }
Property Value
SpanOfT
The type symbol for Span<T>.
public INamedTypeSymbol? SpanOfT { get; }
Property Value
SystemValueType
The type symbol for ValueType.
public INamedTypeSymbol SystemValueType { get; }
Property Value
TargetFramework
Gets the resolved target framework of the current compilation
public TargetFramework TargetFramework { get; }
Property Value
TaskType
The type symbol for Task.
public INamedTypeSymbol? TaskType { get; }
Property Value
TupleOfKV
The type symbol for Tuple<T1, T2>.
public INamedTypeSymbol? TupleOfKV { get; }
Property Value
UnionAttribute
The type symbol for System.Runtime.CompilerServices.UnionAttribute, when available.
public INamedTypeSymbol? UnionAttribute { get; }
Property Value
ValueTaskOfTType
The type symbol for ValueTask<TResult>.
public INamedTypeSymbol? ValueTaskOfTType { get; }
Property Value
ValueTaskType
The type symbol for ValueTask.
public INamedTypeSymbol? ValueTaskType { get; }
Property Value
Methods
GetOrResolveType(string, ref Option<INamedTypeSymbol?>)
Get or resolve a type by its fully qualified name.
protected INamedTypeSymbol? GetOrResolveType(string fullyQualifiedName, ref KnownSymbols.Option<INamedTypeSymbol?> field)
Parameters
fullyQualifiedNamestringThe fully qualified name of the type to resolve.
fieldKnownSymbols.Option<INamedTypeSymbol>A field in which to cache the result for future use.
Returns
- INamedTypeSymbol
The type symbol result or null if not found.
IsScalarType(ITypeSymbol)
A scalar type in this context defines a type that is either a primitive, string or represents an irreducible value such as Guid or DateTime.
public bool IsScalarType(ITypeSymbol type)
Parameters
typeITypeSymbol
Returns
Remarks
Half, Int128, UInt128, DateOnly, TimeOnly, and Rune are recognized by metadata name, including user-defined polyfills.