Implement subtype ascription

This commit is contained in:
Shunsuke Shibayama 2022-10-19 19:04:50 +09:00
parent 6613fd85c2
commit cb4c2c7bbf
5 changed files with 120 additions and 48 deletions

View file

@ -3011,6 +3011,14 @@ impl TypeAscription {
t_spec,
}
}
pub fn is_instance_ascription(&self) -> bool {
self.op.is(TokenKind::Colon)
}
pub fn is_subtype_ascription(&self) -> bool {
self.op.is(TokenKind::SubtypeOf)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]