Skip to content

Commit

Permalink
Fix assertion failure in type inference (#13352)
Browse files Browse the repository at this point in the history
  • Loading branch information
wildbook committed Oct 5, 2022
1 parent 476d043 commit 8862fe6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2807,6 +2807,10 @@ impl Type {
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
Some(subst)
}
ItemContainerId::ImplId(id) => {
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
Some(subst)
}
_ => None,
},
_ => None,
Expand Down
16 changes: 16 additions & 0 deletions crates/ide/src/highlight_related.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,22 @@ fn main() {
().func$0();
//^^^^
}
"#,
);
}

#[test]
fn test_assoc_type_highlighting() {
check(
r#"
trait Trait {
type Output;
// ^^^^^^
}
impl Trait for () {
type Output$0 = ();
// ^^^^^^
}
"#,
);
}
Expand Down

0 comments on commit 8862fe6

Please sign in to comment.