Struct kailua_types::ty::SlotSeq
[−]
[src]
pub struct SlotSeq { pub head: Vec<Slot>, pub tail: Option<Slot>, }
A sequence of slot types.
Fields
head: Vec<Slot>
The "head" types, a list of finite types at the beginning of the sequence.
tail: Option<Slot>
The optional "tail" type. If present, it repeats indefinitely after "head".
This is implicitly nilable, because the actual value represented by the sequence
is never infinite, so there should be a nil
somewhere.
Since we don't know where it ends,
the tail should be implicitly unioned with nil
in all practical sense.
We may implicitly put the nil
here if it's missing,
but the absence of the tail type makes a few important differences in checking.
For example, function arguments are a sequence,
and excess parameters to non-variadic arguments should be forbidden
even if those excess parameters are always nil
.
This is only possible when we have a separate way to mark a missing tail.
Methods
impl SlotSeq
[src]
fn new() -> SlotSeq
fn from_seq(seq: TySeq) -> SlotSeq
fn dummy() -> SlotSeq
fn ensure_at(&mut self, i: usize) -> &Slot
fn ensure_at_mut(&mut self, i: usize) -> &mut Slot
fn ensure_tail(self) -> Self
fn into_iter(self) -> SeqIter<Slot>
fn into_iter_with_none(
self
) -> Chain<Map<SeqIter<Slot>, fn(_: Slot) -> Option<Slot>>, Repeat<Option<Slot>>>
self
) -> Chain<Map<SeqIter<Slot>, fn(_: Slot) -> Option<Slot>>, Repeat<Option<Slot>>>
fn into_iter_with_nil(self) -> Chain<SeqIter<Slot>, Repeat<Slot>>
fn into_first(self) -> Slot
fn unlift(self) -> TySeq
impl SlotSeq
[src]
fn all_with_loc<Loc: Into<Span>>(self, loc: Loc) -> SpannedSlotSeq
fn all_without_loc(self) -> SpannedSlotSeq
Trait Implementations
impl Clone for SlotSeq
[src]
fn clone(&self) -> SlotSeq
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for SlotSeq
[src]
fn eq(&self, __arg_0: &SlotSeq) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SlotSeq) -> bool
This method tests for !=
.
impl<'a> From<T<'a>> for SlotSeq
[src]
impl From<Ty> for SlotSeq
[src]
impl From<Slot> for SlotSeq
[src]
impl Dummy for SlotSeq
[src]
impl Union for SlotSeq
[src]
type Output = SlotSeq
A type of the resulting type.
fn union(
&self,
other: &SlotSeq,
explicit: bool,
ctx: &mut TypeContext
) -> TypeResult<SlotSeq>
&self,
other: &SlotSeq,
explicit: bool,
ctx: &mut TypeContext
) -> TypeResult<SlotSeq>
Calculates a union type of self
and other
, explicitly or implicitly. Read more
impl Lattice for SlotSeq
[src]
fn assert_sub(&self, other: &SlotSeq, ctx: &mut TypeContext) -> TypeResult<()>
Asserts that self
is a consistent subtype of other
under the type context.
fn assert_eq(&self, other: &SlotSeq, ctx: &mut TypeContext) -> TypeResult<()>
Asserts that self
is a consistent type equal to other
under the type context.