From afaa26636e4391ebacfc09e9c994c11bab58b834 Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Tue, 15 Jan 2019 15:24:04 +0100 Subject: Add additional pattern variants --- crates/ra_hir/src/ty/tests.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/ra_hir/src/ty/tests.rs') diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index a430cbe88..fc1e5b09c 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -358,6 +358,21 @@ fn test(x: &str, y: isize) { ); } +#[test] +fn infer_pattern() { + check_inference( + r#" +fn test(x: &i32) { + let y = x; + let &z = x; + let a = z; + let (c, d) = (1, "hello"); +} +"#, + "pattern.txt", + ); +} + fn infer(content: &str) -> String { let (db, _, file_id) = MockDatabase::with_single_file(content); let source_file = db.source_file(file_id); -- cgit v1.2.3