mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Implement subtype ascription
This commit is contained in:
parent
6613fd85c2
commit
cb4c2c7bbf
5 changed files with 120 additions and 48 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue