Skip to content

Commit 204c8de

Browse files
committed
Add test for issue
1 parent af00167 commit 204c8de

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

crates/ra_hir_ty/src/tests/regression.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,35 @@ fn foo(b: Bar) {
534534
);
535535
}
536536

537+
#[test]
538+
fn issue_4235_name_conflicts() {
539+
assert_snapshot!(
540+
infer(r#"
541+
struct FOO {}
542+
static FOO:FOO = FOO {};
543+
544+
impl FOO {
545+
fn foo(&self) {}
546+
}
547+
548+
fn main() {
549+
let a = &FOO;
550+
a.foo();
551+
}
552+
"#), @r###"
553+
32..38 'FOO {}': FOO
554+
64..68 'self': &FOO
555+
70..72 '{}': ()
556+
86..120 '{ ...o(); }': ()
557+
96..97 'a': &FOO
558+
100..104 '&FOO': &FOO
559+
101..104 'FOO': FOO
560+
110..111 'a': &FOO
561+
110..117 'a.foo()': ()
562+
"###
563+
);
564+
}
565+
537566
#[test]
538567
fn issue_4053_diesel_where_clauses() {
539568
assert_snapshot!(

0 commit comments

Comments
 (0)