feat: add as operator

This commit is contained in:
Shunsuke Shibayama 2023-04-19 15:20:46 +09:00
parent 1c6a6b2ec8
commit daf01f3cf2
14 changed files with 119 additions and 12 deletions

View file

@ -482,6 +482,11 @@ pub fn subtypeof(sup: Type) -> Constraint {
Constraint::new_sandwiched(Type::Never, sup)
}
#[inline]
pub fn supertypeof(sub: Type) -> Constraint {
Constraint::new_sandwiched(sub, Type::Obj)
}
#[inline]
pub fn mono_q_tp<S: Into<Str>>(name: S, constr: Constraint) -> TyParam {
TyParam::mono_q(name, constr)