diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-08 15:01:19 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-10 13:32:56 +0000 |
commit | 978de5cf8bfd2ff82696fc8d5369b41e147431c3 (patch) | |
tree | 27a25a5f2fb20a4afffed97cbb5b678b251d254b /crates/ra_hir/src/ty/tests.rs | |
parent | aca14c591fea40b2f803bbf5f02c1571732348fb (diff) |
Implement type inference for enum variants
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index ba2a44474..d8c0af326 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -95,6 +95,22 @@ fn test() { | |||
95 | } | 95 | } |
96 | 96 | ||
97 | #[test] | 97 | #[test] |
98 | fn infer_enum() { | ||
99 | check_inference( | ||
100 | r#" | ||
101 | enum E { | ||
102 | V1 { field: u32 }, | ||
103 | V2 | ||
104 | } | ||
105 | fn test() { | ||
106 | E::V1 { field: 1 }; | ||
107 | E::V2; | ||
108 | }"#, | ||
109 | "enum.txt", | ||
110 | ); | ||
111 | } | ||
112 | |||
113 | #[test] | ||
98 | fn infer_refs() { | 114 | fn infer_refs() { |
99 | check_inference( | 115 | check_inference( |
100 | r#" | 116 | r#" |