type

Slot

src abstract const class Slot : Obj

Slot represents a member field or method on a Type.

methods

doc

Return the raw fandoc for this slot or null if not available.

facet

Get a facet by its type.

facets

Get the list of facets defined on this slot or return an empty list if no facets are defined.

find

Find a Slot by its qualified name "pod::Type.slot".

findField

Convenience for (Field)find(qname, checked)

findFunc

Convenience for findMethod(qname, checked).func

findMethod

Convenience for (Method)find(qname, checked)

hasFacet

Return if this type has the specified facet defined.

isAbstract

Return if slot is abstract (no implementation provided).

isConst

Return if slot is constant and thread safe.

isCtor

Return if slot is constructor method.

isField

Return true if this is an instance of Field.

isInternal

Return if slot has internal protection scope.

isMethod

Return true if this is an instance of Method.

isNative

Return if slot is native.

isOverride

Return if slot is an override (of parent's virtual method).

isPrivate

Return if slot has private protection scope.

isProtected

Return if slot has protected protection scope.

isPublic

Return if slot has public protection scope.

isStatic

Return if slot is static (class based, rather than instance).

isSynthetic

Return if this slot was generated by the compiler.

isVirtual

Return if slot is virtual (may be overridden in subclasses).

name

Simple name of the slot such as "size".

parent

Parent type which defines this slot.

qname

Qualified name such as "sys:Str.size".

signature

Return a string representation of the Fantom code signature.

toStr

Always return qname().

Slot Details

doc

src Str? doc()

Return the raw fandoc for this slot or null if not available.

facet

src Facet? facet(Type type, Bool checked := true)

Get a facet by its type. If not found on this slot then return null or throw UnknownFacetErr based on check flag. See Facets Doc for details.

facets

src Facet[] facets()

Get the list of facets defined on this slot or return an empty list if no facets are defined. If looking up a facet by type, then use the facet method which will provide better performance. See Facets Doc for details.

find

src static Slot? find(Str qname, Bool checked := true)

Find a Slot by its qualified name "pod::Type.slot". If the slot doesn't exist and checked is false then return null, otherwise throw UnknownSlotErr.

findField

src static Field? findField(Str qname, Bool checked := true)

Convenience for (Field)find(qname, checked)

findFunc

src static Func? findFunc(Str qname, Bool checked := true)

Convenience for findMethod(qname, checked).func

findMethod

src static Method? findMethod(Str qname, Bool checked := true)

Convenience for (Method)find(qname, checked)

hasFacet

src Bool hasFacet(Type type)

Return if this type has the specified facet defined.

isAbstract

src Bool isAbstract()

Return if slot is abstract (no implementation provided).

isConst

src Bool isConst()

Return if slot is constant and thread safe. A constant field is explicitly marked with the const modifier and guaranteed to always reference the same immutable object for the life of the VM. A const method is guaranteed to not capture any state from its thread, and is safe to execute on other threads. The compiler marks methods as const based on the following analysis:

  • static methods are always automatically const
  • instance methods are never const
  • closures which don't capture any variables from their scope are automatically const
  • partial apply methods which only capture const variables from their scope are automatically const

isCtor

src Bool isCtor()

Return if slot is constructor method.

isField

src Bool isField()

Return true if this is an instance of Field.

isInternal

src Bool isInternal()

Return if slot has internal protection scope.

isMethod

src Bool isMethod()

Return true if this is an instance of Method.

isNative

src Bool isNative()

Return if slot is native.

isOverride

src Bool isOverride()

Return if slot is an override (of parent's virtual method).

isPrivate

src Bool isPrivate()

Return if slot has private protection scope.

isProtected

src Bool isProtected()

Return if slot has protected protection scope.

isPublic

src Bool isPublic()

Return if slot has public protection scope.

isStatic

src Bool isStatic()

Return if slot is static (class based, rather than instance).

isSynthetic

src Bool isSynthetic()

Return if this slot was generated by the compiler.

isVirtual

src Bool isVirtual()

Return if slot is virtual (may be overridden in subclasses).

name

src Str name()

Simple name of the slot such as "size".

parent

src Type parent()

Parent type which defines this slot.

qname

src Str qname()

Qualified name such as "sys:Str.size".

signature

src virtual Str signature()

Return a string representation of the Fantom code signature.

toStr

src virtual override Str toStr()

Always return qname().