Fix subtyping bug

This commit is contained in:
Shunsuke Shibayama 2022-10-21 20:04:14 +09:00
parent 978866b31a
commit c39973f536
7 changed files with 110 additions and 19 deletions

View file

@ -55,6 +55,14 @@ impl Field {
Field { vis, symbol }
}
pub const fn private(symbol: Str) -> Self {
Field::new(Visibility::Private, symbol)
}
pub const fn public(symbol: Str) -> Self {
Field::new(Visibility::Public, symbol)
}
pub fn is_const(&self) -> bool {
self.symbol.starts_with(char::is_uppercase)
}