fix: contains_opaque was never intended to be used for type equality
This commit is contained in:
parent
5cec2544b3
commit
c20ff6b160
|
@ -1976,12 +1976,7 @@ fn forbid_expect_into_nested_opaque_in_record_without_typecasting() {
|
|||
}
|
||||
"#;
|
||||
|
||||
panic!("");
|
||||
|
||||
assert!(matches!(
|
||||
check(parse(source_code)),
|
||||
Err((_, Error::ExpectOnOpaqueType { .. }))
|
||||
))
|
||||
assert!(check(parse(source_code)).is_ok())
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -81,7 +81,7 @@ impl PartialEq for Type {
|
|||
module,
|
||||
name,
|
||||
args,
|
||||
contains_opaque: opaque,
|
||||
contains_opaque: _,
|
||||
alias: _,
|
||||
} => {
|
||||
if let Type::App {
|
||||
|
@ -89,14 +89,13 @@ impl PartialEq for Type {
|
|||
module: module2,
|
||||
name: name2,
|
||||
args: args2,
|
||||
contains_opaque: opaque2,
|
||||
contains_opaque: _,
|
||||
alias: _,
|
||||
} = other
|
||||
{
|
||||
name == name2
|
||||
&& module == module2
|
||||
&& public == public2
|
||||
&& opaque == opaque2
|
||||
&& args.iter().zip(args2).all(|(left, right)| left == right)
|
||||
} else {
|
||||
false
|
||||
|
|
|
@ -1408,9 +1408,6 @@ impl<'a> Environment<'a> {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
println!("lhs: {lhs:#?}");
|
||||
println!("rhs: {rhs:#?}");
|
||||
|
||||
// TODO: maybe we also care to check is_link?
|
||||
if allow_cast
|
||||
&& (lhs.is_data() || rhs.is_data())
|
||||
|
|
Loading…
Reference in New Issue