diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index c1024d03c..abfaffb5e 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -1980,6 +1980,30 @@ fn test() { | |||
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | #[test] | 1982 | #[test] |
1983 | fn infer_associated_method_generics_with_default_tuple_param() { | ||
1984 | let t = type_at( | ||
1985 | r#" | ||
1986 | //- /main.rs | ||
1987 | struct Gen<T=()> { | ||
1988 | val: T | ||
1989 | } | ||
1990 | |||
1991 | impl<T> Gen<T> { | ||
1992 | pub fn make() -> Gen<T> { | ||
1993 | loop { } | ||
1994 | } | ||
1995 | } | ||
1996 | |||
1997 | fn test() { | ||
1998 | let a = Gen::make(); | ||
1999 | a.val<|>; | ||
2000 | } | ||
2001 | "#, | ||
2002 | ); | ||
2003 | assert_eq!(t, "()"); | ||
2004 | } | ||
2005 | |||
2006 | #[test] | ||
1983 | fn infer_associated_method_generics_without_args() { | 2007 | fn infer_associated_method_generics_without_args() { |
1984 | assert_snapshot!( | 2008 | assert_snapshot!( |
1985 | infer(r#" | 2009 | infer(r#" |