aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-20 08:47:42 +0000
committerGitHub <[email protected]>2019-11-20 08:47:42 +0000
commitd24e8f9ea42dd2d08b2e02f8106690fd4baa8071 (patch)
tree3da030379556170d1d18235c234ae95bbe28fba4 /crates/ra_hir/src/ty/tests.rs
parent4340d9b0e435bde11c0cc79e9f284856a836ccdc (diff)
parent0e771915faf057ec4561224b75ec9b5be93d71c8 (diff)
Merge #2321
2321: Allow non-path default type parameters r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs24
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]
1983fn infer_associated_method_generics_with_default_tuple_param() {
1984 let t = type_at(
1985 r#"
1986//- /main.rs
1987struct Gen<T=()> {
1988 val: T
1989}
1990
1991impl<T> Gen<T> {
1992 pub fn make() -> Gen<T> {
1993 loop { }
1994 }
1995}
1996
1997fn test() {
1998 let a = Gen::make();
1999 a.val<|>;
2000}
2001"#,
2002 );
2003 assert_eq!(t, "()");
2004}
2005
2006#[test]
1983fn infer_associated_method_generics_without_args() { 2007fn infer_associated_method_generics_without_args() {
1984 assert_snapshot!( 2008 assert_snapshot!(
1985 infer(r#" 2009 infer(r#"