@@ -742,6 +742,10 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t, bool boxed) -> TypeRef {
742
742
case ( ty. ty_param ( _) ) {
743
743
llty = T_i8 ( ) ;
744
744
}
745
+ case ( ty. ty_bound_param ( _) ) {
746
+ log "ty_bound_param in trans.type_of" ;
747
+ fail;
748
+ }
745
749
case ( ty. ty_type ) { llty = T_ptr ( T_tydesc ( cx. tn ) ) ; }
746
750
}
747
751
@@ -1144,6 +1148,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
1144
1148
auto tup_ty = ty. plain_tup_ty ( args) ;
1145
1149
1146
1150
// Perform any type parameter substitutions.
1151
+ tup_ty = ty. bind_params_in_type ( tup_ty) ;
1147
1152
tup_ty = ty. substitute_type_params ( subtys, tup_ty) ;
1148
1153
1149
1154
// Here we possibly do a recursive call.
@@ -1216,7 +1221,8 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
1216
1221
let vec[ @ty. t] raw_tys = variant. args;
1217
1222
let vec[ @ty. t] tys = vec( ) ;
1218
1223
for ( @ty. t raw_ty in raw_tys) {
1219
- auto t = ty. substitute_type_params( tps, raw_ty) ;
1224
+ auto t = ty. bind_params_in_type( raw_ty) ;
1225
+ t = ty. substitute_type_params( tps, t) ;
1220
1226
tys += vec( t) ;
1221
1227
}
1222
1228
@@ -1390,7 +1396,8 @@ fn GEP_tag(@block_ctxt cx,
1390
1396
auto i = 0 ;
1391
1397
let vec[ @ty. t] true_arg_tys = vec ( ) ;
1392
1398
for ( @ty. t aty in arg_tys) {
1393
- auto arg_ty = ty. substitute_type_params( ty_substs, aty) ;
1399
+ auto arg_ty = ty. bind_params_in_type( aty) ;
1400
+ arg_ty = ty. substitute_type_params( ty_substs, arg_ty) ;
1394
1401
true_arg_tys += vec( arg_ty) ;
1395
1402
if ( i == ix) {
1396
1403
elem_ty = arg_ty;
@@ -2118,8 +2125,9 @@ fn iter_structural_ty_full(@block_ctxt cx,
2118
2125
auto llfldp_b = rslt. val;
2119
2126
variant_cx = rslt. bcx;
2120
2127
2121
- auto ty_subst =
2122
- ty. substitute_type_params( tps, a. ty) ;
2128
+ auto ty_subst = ty. bind_params_in_type( a. ty) ;
2129
+ ty_subst =
2130
+ ty. substitute_type_params( tps, ty_subst) ;
2123
2131
2124
2132
auto llfld_a =
2125
2133
load_if_immediate( variant_cx,
@@ -2501,15 +2509,10 @@ fn target_type(@crate_ctxt cx, @ty.t t) -> @ty.t {
2501
2509
ret t;
2502
2510
}
2503
2511
2512
+
2513
+ // Converts an annotation to a type
2504
2514
fn node_ann_type( @crate_ctxt cx, & ast. ann a) -> @ty. t {
2505
- alt ( a) {
2506
- case ( ast. ann_none) {
2507
- cx. sess. bug( "missing type annotation") ;
2508
- }
2509
- case ( ast. ann_type( ?t, _, _) ) {
2510
- ret target_type( cx, t) ;
2511
- }
2512
- }
2515
+ ret target_type( cx, ty. ann_to_monotype( a) ) ;
2513
2516
}
2514
2517
2515
2518
fn node_ann_ty_params( & ast. ann a) -> vec[ @ty. t] {
0 commit comments