rustc: Fail to unify if two ty_vars don't unify

Closes #500
This commit is contained in:
Brian Anderson 2011-06-17 11:23:32 -07:00
parent 2a69db5b76
commit a4d88dacc9
2 changed files with 15 additions and 1 deletions

View File

@ -1943,7 +1943,12 @@ mod unify {
alt (struct(cx.tcx, expected)) {
case (ty::ty_var(?expected_id)) {
auto expected_n = expected_id as uint;
union(cx, expected_n, actual_n);
alt(union(cx, expected_n, actual_n)) {
case (unres_ok) { /* fall through */ }
case (unres_err(?t_e)) {
ret ures_err(t_e);
}
}
}
case (_) {

View File

@ -0,0 +1,9 @@
// xfail-stage0
// error-pattern:mismatched types
// issue #500
fn main() {
auto x = true;
auto y = 1;
auto z = x + y;
}