Don't trigger unresolved method/field diagnostics on types containing errors

This commit is contained in:
Lukas Wirth 2023-03-07 15:24:43 +01:00
parent 31c12ec282
commit d45708fabe
3 changed files with 21 additions and 3 deletions

View file

@ -129,6 +129,19 @@ fn foo() {
Foo.bar;
// ^^^^^^^ 💡 error: no field `bar` on type `Foo`, but a method with a similar name exists
}
"#,
);
}
#[test]
fn no_diagnostic_on_unknown() {
check_diagnostics(
r#"
fn foo() {
x.foo;
(&x).foo;
(&((x,),),).foo;
}
"#,
);
}