fix: contains_opaque was never intended to be used for type equality

This commit is contained in:
rvcas 2024-03-21 11:30:01 -04:00 committed by Lucas
parent 5cec2544b3
commit c20ff6b160
3 changed files with 3 additions and 12 deletions

View File

@ -1976,12 +1976,7 @@ fn forbid_expect_into_nested_opaque_in_record_without_typecasting() {
} }
"#; "#;
panic!(""); assert!(check(parse(source_code)).is_ok())
assert!(matches!(
check(parse(source_code)),
Err((_, Error::ExpectOnOpaqueType { .. }))
))
} }
#[test] #[test]

View File

@ -81,7 +81,7 @@ impl PartialEq for Type {
module, module,
name, name,
args, args,
contains_opaque: opaque, contains_opaque: _,
alias: _, alias: _,
} => { } => {
if let Type::App { if let Type::App {
@ -89,14 +89,13 @@ impl PartialEq for Type {
module: module2, module: module2,
name: name2, name: name2,
args: args2, args: args2,
contains_opaque: opaque2, contains_opaque: _,
alias: _, alias: _,
} = other } = other
{ {
name == name2 name == name2
&& module == module2 && module == module2
&& public == public2 && public == public2
&& opaque == opaque2
&& args.iter().zip(args2).all(|(left, right)| left == right) && args.iter().zip(args2).all(|(left, right)| left == right)
} else { } else {
false false

View File

@ -1408,9 +1408,6 @@ impl<'a> Environment<'a> {
return Ok(()); return Ok(());
} }
println!("lhs: {lhs:#?}");
println!("rhs: {rhs:#?}");
// TODO: maybe we also care to check is_link? // TODO: maybe we also care to check is_link?
if allow_cast if allow_cast
&& (lhs.is_data() || rhs.is_data()) && (lhs.is_data() || rhs.is_data())