Vixen
02b45cc4
csharp
public record class LibraryTypeReference

A reference to a type from somewhere else in the artefact: a member's type, a base, a constraint.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Deliberately not a serialized TypeSymbol. A primitive travels as its SpecialType, which is the identity the whole binder keys off; a declared type travels as a qualified name, which is stable across a recompilation of the library and resolvable against another library's types. Only structural types — arrays and tuples — carry their shape, because they have no name to be resolved by.

Fields and properties (11)

  • public LibraryTypeKind Kind
  • public SpecialType Special

    For Primitive and BuiltIn.

  • public string? Name

    Qualified name for a declared type, simple name for a type parameter.

  • public LibraryTypeReference? Element

    Element type of an array.

  • public int Rank

    Array rank; T[,] is 2.

  • public int? Length

    Array length, or null when unsized. Part of the type rather than a detail of it: float[4] and float[] are different types, so a signature that lost the length would resolve to something the source never declared.

  • public bool Writable

    For Buffer: whether it is the RWBuffer form. Part of the type, because a store into the read-only form is RVN2119 and losing the direction would silently make it legal.

  • public ImmutableArray<LibraryTypeReference> Elements

    Element types of a tuple.

  • public ImmutableArray<string?> ElementNames

    Element names of a tuple; an entry is null for an unnamed element.

  • public ImmutableArray<LibraryTypeReference> TypeArguments

    Type arguments, for a reference to a constructed generic type.

  • public static LibraryTypeReference ErrorType

Methods (1)

Used by (9)

  • BuilderVixen.Raven
  • LibraryFieldVixen.Raven
  • LibraryMethodVixen.Raven
  • LibraryParameterVixen.Raven
  • LibraryPropertyVixen.Raven
  • LibraryTypeVixen.Raven
  • LibraryTypeParameterVixen.Raven
  • MetadataLoaderVixen.Raven
  • MetadataNamedTypeSymbolVixen.Raven