[][src]Struct lark_type_check::TypeCheckResults

pub struct TypeCheckResults<F: TypeFamily> {
    pub max_types: BTreeMap<MetaIndex, Ty<F>>,
    pub access_types: BTreeMap<Expression, Ty<F>>,
    pub access_permissions: BTreeMap<Expression, F::Perm>,
    pub generics: BTreeMap<MetaIndex, Generics<F>>,
    pub entities: BTreeMap<MetaIndex, Entity>,
}

Fields

max_types: BTreeMap<MetaIndex, Ty<F>>

The "maximum type" computed for expressions, identified-expressions, and other things that have a type. The maximum type is the full set of permissions available from that expression.

access_types: BTreeMap<Expression, Ty<F>>

The "access type" for a given expression -- this is the set of permissions required by that particular expression. These cannot exceed the "max types" and are determined by how the result of the expression is used.

access_permissions: BTreeMap<Expression, F::Perm>

The "permission variable" recorded for a given expression instance.

generics: BTreeMap<MetaIndex, Generics<F>>

For references to entities, the generics applied.

entities: BTreeMap<MetaIndex, Entity>

For "type-relative" identifiers, stores the entity that we resolved to. Examples:

  • foo.bar -- attached to the identifier bar, entity of the field
  • foo.bar(..) -- attached to the identifier bar, entity of the method
  • Foo { a: b } -- attached to the identifier a, entity of the field
  • foo -- when an identifier refers to an entity

Methods

impl<F: TypeFamily> TypeCheckResults<F>[src]

pub fn ty(
    &self,
    index: impl Into<MetaIndex>
) -> Ty<F>
[src]

Access the type stored for the given index, usually the index of an expression. Indicates the "maximum type".

pub fn access_ty(&self, expression: Expression) -> Ty<F>[src]

Returns the "access type" of this expression, which indicates how many permissions were needed.

pub fn opt_ty(
    &self,
    index: impl Into<MetaIndex>
) -> Option<Ty<F>>
[src]

Load the type for index, if any is stored, else return None.

pub fn has_recorded_ty(
    &self,
    index: impl Into<MetaIndex>
) -> bool
[src]

Check whether there is a type recorded for index.

Trait Implementations

impl<F: Eq + TypeFamily> Eq for TypeCheckResults<F> where
    F::Perm: Eq
[src]

impl<F: Clone + TypeFamily> Clone for TypeCheckResults<F> where
    F::Perm: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<F: PartialEq + TypeFamily> PartialEq<TypeCheckResults<F>> for TypeCheckResults<F> where
    F::Perm: PartialEq
[src]

impl<F: TypeFamily> Default for TypeCheckResults<F>[src]

impl<F: Hash + TypeFamily> Hash for TypeCheckResults<F> where
    F::Perm: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<F: Debug + TypeFamily> Debug for TypeCheckResults<F> where
    F::Perm: Debug
[src]

impl<S, T> Map<S, T> for TypeCheckResults<S> where
    S: TypeFamily,
    T: TypeFamily
[src]

type Output = TypeCheckResults<T>

Auto Trait Implementations

impl<F> Send for TypeCheckResults<F> where
    <F as TypeFamily>::Base: Send + Sync,
    <F as TypeFamily>::Perm: Send + Sync,
    <F as TypeFamily>::Repr: Send + Sync

impl<F> Sync for TypeCheckResults<F> where
    <F as TypeFamily>::Base: Send + Sync,
    <F as TypeFamily>::Perm: Send + Sync,
    <F as TypeFamily>::Repr: Send + Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized
[src]

impl<T> Erased for T