pub enum TypeAtom {
Paren {
paren: ParenGroup<()>,
inner: TyErasedV1,
},
Record {
rec: RecordGroup<()>,
inner: TypeRecordInnerV1,
},
Var(TypeVarTok),
LongName(VarWithModTok),
Name(VarTok),
}Expand description
An atomic type expression. parser_v1.mly:740-752’s record forms are
fully modeled: both the closed form and the open (row-var-tailed) form
share TypeAtom::Record, distinguished by
TypeRecordInnerV1::row_tail.
Variants§
Paren
( ty )
Record
(| l1 : ty1, l2 : ty2, … |) (closed) or (| l1 : ty1, … | ?'r |)
(open — a row-variable tail)
(typ_bot‘s two L_RECORD arms, parser_v1.mly:746-749;
typ_record_elem :775-777 — COLON fields, unlike record
EXPRESSIONS’ l = e). Lowered (v1/lower.rs): the closed form to
the existing cst::ast::TypeAtom::Record (cst.rs:1344) and
thence to a closed MonoType::Record row (typecheck.rs:512);
the open form to the additive cst::ast::TypeAtom::RecordOpen
and thence to an OPEN MonoType::Record(Row::Var(…)) — a fresh
row variable, using the existing generic Row/RowVarRef/
unify_row machinery (no new type machinery needed).
Var(TypeVarTok)
A type variable, e.g. 'a.
LongName(VarWithModTok)
M.t — a qualified type name (upstream
LONG_LOWER, parser.mly:742-743). VarWithModTok-headed,
token-disjoint from Var/Name/Paren (TypeVarTok/VarTok/
LParenTok) — see TypeApp::AppliedLong’s doc comment.
Name(VarTok)
A (possibly qualified) type name, e.g. int, string.
Trait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeAtomwhere
__SyanMacro_Atom: Spanned + Clone,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_TypeAtom_Paren_1383305089136131385: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_TypeAtom_Record_1383305089136131385: Parse<__SyanMacro_Atom>,
TypeVarTok: Parse<__SyanMacro_Atom>,
VarWithModTok: Parse<__SyanMacro_Atom>,
VarTok: Parse<__SyanMacro_Atom>,
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeAtomwhere
__SyanMacro_Atom: Spanned + Clone,
ParenGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_paren_TypeAtom_Paren_1383305089136131385: Parse<__SyanMacro_Atom>,
RecordGroup<()>: GroupShape<__SyanMacro_Atom>,
__SyanSubstructOfOwn_rec_TypeAtom_Record_1383305089136131385: Parse<__SyanMacro_Atom>,
TypeVarTok: Parse<__SyanMacro_Atom>,
VarWithModTok: Parse<__SyanMacro_Atom>,
VarTok: Parse<__SyanMacro_Atom>,
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.