aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-01-18 17:18:51 -0800
committerGraydon Hoare <[email protected]>2011-01-18 17:18:51 -0800
commit9cc00d5f6cc85a825e79e29324261daa17e50048 (patch)
treef2e57f4df10cfede3d8bd7de2fcf31c4e29832ab /src
parentOne last refactoring of the import handling: (diff)
downloadrust-9cc00d5f6cc85a825e79e29324261daa17e50048.tar.xz
rust-9cc00d5f6cc85a825e79e29324261daa17e50048.zip
Fix bug (I think) when unifying ty_local and ty_param.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/ty.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index e910c23a..531e3f85 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -889,7 +889,19 @@ fn unify(@ty.t expected, @ty.t actual, &unify_handler handler)
ret result;
}
case (ty.ty_param(?actual_id)) {
- ret handler.unify_actual_param(actual_id, expected, actual);
+ alt (expected.struct) {
+
+ // These two unify via logic lower down. Fall through.
+ case (ty.ty_local(_)) { }
+ case (ty.ty_var(_)) { }
+
+ // More-concrete types can unify against params here.
+ case (_) {
+ ret handler.unify_actual_param(actual_id,
+ expected,
+ actual);
+ }
+ }
}
case (_) { /* empty */ }
}