support _type_.repr expression
This commit is contained in:
parent
257d129ca6
commit
23b0305f30
|
@ -473,13 +473,21 @@ impl Expr {
|
|||
for (ispan, i) in &*then {
|
||||
let span = ispan.into();
|
||||
match pt {
|
||||
pt @ (Expr::TyTy
|
||||
| Expr::Tbool
|
||||
| Expr::Tu32
|
||||
| Expr::Tusize
|
||||
| Expr::Record(_)) => {
|
||||
pt @ (Expr::Tbool | Expr::Tu32 | Expr::Tusize | Expr::Record(_)) => {
|
||||
return Err(Error::InvalidSelect { span, ty: pt });
|
||||
}
|
||||
Expr::TyTy => {
|
||||
pt = match &**i {
|
||||
"repr" => Expr::Trepr,
|
||||
_ => {
|
||||
return Err(Error::SelectNotFoundTy {
|
||||
span,
|
||||
name: i.clone(),
|
||||
ty: Expr::TyTy,
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
Expr::Trepr => {
|
||||
pt = match &**i {
|
||||
"len" | "align" => Expr::Tusize,
|
||||
|
|
Loading…
Reference in a new issue