Fix unification bug
Hello from SFO Terminal 3! unify_fn_common had the expected and actual types reversed in one place. This was causing the type of an occurence of a function f with type fn(int) -> T to be set to fn(_|_) -> T at a call site like f(fail); I think this was also making some of the type error messages come out backwards, but I haven't checked. Also: ty_bot does not contain pointers
This commit is contained in:
parent
c515ed13de
commit
468786e36d
|
@ -981,6 +981,7 @@ fn type_has_pointers(&ctxt cx, &t ty) -> bool {
|
|||
alt (struct(cx, ty)) {
|
||||
// scalar types
|
||||
case (ty_nil) { ret false; }
|
||||
case (ty_bot) { ret false; }
|
||||
case (ty_bool) { ret false; }
|
||||
case (ty_int) { ret false; }
|
||||
case (ty_float) { ret false; }
|
||||
|
@ -2049,7 +2050,7 @@ mod unify {
|
|||
result_mode = expected_input.mode;
|
||||
}
|
||||
|
||||
auto result = unify_step(cx, actual_input.ty, expected_input.ty);
|
||||
auto result = unify_step(cx, expected_input.ty, actual_input.ty);
|
||||
|
||||
alt (result) {
|
||||
case (ures_ok(?rty)) {
|
||||
|
|
Loading…
Reference in New Issue