about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 2594590a4b9..45f59841a96 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -621,11 +621,22 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t) -> TypeRef {
 }
 
 fn type_of_arg(@crate_ctxt cx, &ty.arg arg) -> TypeRef {
-    auto ty = type_of_inner(cx, arg.ty);
+    alt (arg.ty.struct) {
+        case (ty.ty_param(_)) {
+            if (arg.mode == ast.alias) {
+                ret T_typaram_ptr(cx.tn);
+            }
+        }
+        case (_) {
+            // fall through
+        }
+    }
+
+    auto typ = type_of_inner(cx, arg.ty);
     if (arg.mode == ast.alias) {
-        ty = T_ptr(ty);
+        typ = T_ptr(typ);
     }
-    ret ty;
+    ret typ;
 }
 
 // Name sanitation. LLVM will happily accept identifiers with weird names, but