mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
fix: Type::{And, Or}(Set<Type>)
This commit is contained in:
parent
82bc710827
commit
b0c31370c5
14 changed files with 661 additions and 466 deletions
|
@ -116,9 +116,12 @@ impl Context {
|
|||
return Some(hint);
|
||||
}
|
||||
}
|
||||
(Type::And(l, r), found) => {
|
||||
let left = self.readable_type(l.as_ref().clone());
|
||||
let right = self.readable_type(r.as_ref().clone());
|
||||
(Type::And(tys), found) if tys.len() == 2 => {
|
||||
let mut iter = tys.iter();
|
||||
let l = iter.next().unwrap();
|
||||
let r = iter.next().unwrap();
|
||||
let left = self.readable_type(l.clone());
|
||||
let right = self.readable_type(r.clone());
|
||||
if self.supertype_of(l, found) {
|
||||
let msg = switch_lang!(
|
||||
"japanese" => format!("型{found}は{left}のサブタイプですが、{right}のサブタイプではありません"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue