fix AST for if expressions

then is not always a block...
This commit is contained in:
Aleksey Kladov
2019-01-27 00:23:07 +03:00
parent 2d337c88b0
commit 619af1e22c
6 changed files with 112 additions and 5 deletions

View File

@@ -284,6 +284,23 @@ fn test() {
);
}
#[test]
fn infer_in_elseif() {
check_inference(
"infer_in_elseif",
r#"
struct Foo { field: i32 }
fn main(foo: Foo) {
if true {
} else if false {
foo.field
}
}
"#,
)
}
#[test]
fn infer_inherent_method() {
check_inference(