cl-ast: destination side of type alias should be an identifier
This commit is contained in:
parent
bdf0bb68ca
commit
7b40ddc845
@ -90,7 +90,7 @@ pub enum ItemKind {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct Alias {
|
pub struct Alias {
|
||||||
pub to: Box<Ty>,
|
pub to: Identifier,
|
||||||
pub from: Option<Box<Ty>>,
|
pub from: Option<Box<Ty>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ impl<'t> Parser<'t> {
|
|||||||
const PARSING: Parsing = Parsing::Alias;
|
const PARSING: Parsing = Parsing::Alias;
|
||||||
self.match_kw(Keyword::Type, PARSING)?;
|
self.match_kw(Keyword::Type, PARSING)?;
|
||||||
let out = Ok(Alias {
|
let out = Ok(Alias {
|
||||||
to: self.ty()?.into(),
|
to: self.identifier()?,
|
||||||
from: if self.match_type(Type::Eq, PARSING).is_ok() {
|
from: if self.match_type(Type::Eq, PARSING).is_ok() {
|
||||||
Some(self.ty()?.into())
|
Some(self.ty()?.into())
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user