fix AST for if expressions
then is not always a block...
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user