cl-ast: destination side of type alias should be an identifier

This commit is contained in:
John 2024-04-01 04:20:26 -05:00
parent bdf0bb68ca
commit 7b40ddc845
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ pub enum ItemKind {
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Alias {
pub to: Box<Ty>,
pub to: Identifier,
pub from: Option<Box<Ty>>,
}

View File

@ -307,7 +307,7 @@ impl<'t> Parser<'t> {
const PARSING: Parsing = Parsing::Alias;
self.match_kw(Keyword::Type, PARSING)?;
let out = Ok(Alias {
to: self.ty()?.into(),
to: self.identifier()?,
from: if self.match_type(Type::Eq, PARSING).is_ok() {
Some(self.ty()?.into())
} else {