mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
chore: VarInfo.impl_of: Option<Type> -> ctx: ContextKind
This commit is contained in:
parent
1a056b1b0e
commit
14729c94f4
10 changed files with 101 additions and 84 deletions
|
@ -404,6 +404,17 @@ impl Location {
|
|||
matches!(self, Self::Unknown)
|
||||
}
|
||||
|
||||
pub const fn is_real(&self) -> bool {
|
||||
match self {
|
||||
Self::Line(l) => *l != 0,
|
||||
Self::LineRange(lb, le) => *lb != 0 && *le != 0,
|
||||
Self::Range {
|
||||
ln_begin, ln_end, ..
|
||||
} => *ln_begin != 0 && *ln_end != 0,
|
||||
Self::Unknown => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn unknown_or(&self, other: Self) -> Self {
|
||||
if self.is_unknown() {
|
||||
other
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue