cl-ast: Re-add(?) the Infer type-pattern

This commit is contained in:
2025-03-12 01:20:58 -05:00
parent 584207fc8c
commit 11c8daaed0
8 changed files with 20 additions and 5 deletions

View File

@@ -496,7 +496,7 @@ impl Parse<'_> for TypedParam {
if p.match_type(TokenKind::Colon, Parsing::Param).is_ok() {
TyKind::parse(p)?
} else {
TyKind::Path(Path::from(Sym::from("_")))
TyKind::Infer
},
))
}
@@ -742,7 +742,14 @@ impl Parse<'_> for TyKind {
}
}
TokenKind::Fn => TyFn::parse(p)?.into(),
path_like!() => Path::parse(p)?.into(),
path_like!() => {
let path = Path::parse(p)?;
if path.is_sinkhole() {
TyKind::Infer
} else {
TyKind::Path(path)
}
}
t => Err(p.error(Unexpected(t), P))?,
};