Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/regression.rs')
-rw-r--r--crates/hir-ty/src/tests/regression.rs55
1 files changed, 55 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index 9f5f1ea325..259f43e7e2 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -1837,3 +1837,58 @@ fn foo() {
}",
);
}
+
+#[test]
+fn regression_14844() {
+ check_no_mismatches(
+ r#"
+pub type Ty = Unknown;
+
+pub struct Inner<T>();
+
+pub struct Outer {
+ pub inner: Inner<Ty>,
+}
+
+fn main() {
+ _ = Outer {
+ inner: Inner::<i32>(),
+ };
+}
+ "#,
+ );
+ check_no_mismatches(
+ r#"
+pub const ONE: usize = 1;
+
+pub struct Inner<const P: usize>();
+
+pub struct Outer {
+ pub inner: Inner<ONE>,
+}
+
+fn main() {
+ _ = Outer {
+ inner: Inner::<1>(),
+ };
+}
+ "#,
+ );
+ check_no_mismatches(
+ r#"
+pub const ONE: usize = unknown();
+
+pub struct Inner<const P: usize>();
+
+pub struct Outer {
+ pub inner: Inner<ONE>,
+}
+
+fn main() {
+ _ = Outer {
+ inner: Inner::<1>(),
+ };
+}
+ "#,
+ );
+}