.map(|c| (Some(c.return_type()), None))
.unwrap_or((None, None))
},
- ast::Stmt(_it) => (None, None),
+ ast::ParamList(__) => (None, None),
+ ast::Stmt(__) => (None, None),
ast::Item(__) => (None, None),
_ => {
match node.parent() {
expect![[r#"ty: Foo, name: ?"#]],
);
}
+
+ #[test]
+ fn expected_type_param_pat() {
+ check_expected_type_and_name(
+ r#"
+struct Foo { field: u32 }
+fn foo(a$0: Foo) {}
+"#,
+ expect![[r#"ty: Foo, name: ?"#]],
+ );
+ check_expected_type_and_name(
+ r#"
+struct Foo { field: u32 }
+fn foo($0: Foo) {}
+"#,
+ // FIXME make this work, currently fails due to pattern recovery eating the `:`
+ expect![[r#"ty: ?, name: ?"#]],
+ );
+ }
}