File tree Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 4316df63231dbf9c698e1bf464f7cecafea54a0c
2
+ refs/heads/master: 5347cac92d0d44b5f1ca2f3b742a3786b62335d7
Original file line number Diff line number Diff line change @@ -604,15 +604,28 @@ fn iter_structural_ty(@block_ctxt cx,
604
604
605
605
alt ( variant. _1) {
606
606
case ( n_ary) {
607
- // FIXME: broken at the moment, causes type_is_binding
608
- // errors; need to unpack the fn type returned by
609
- // ann_to_type.
610
607
let vec[ ValueRef ] vals = vec( C_int ( 0 ) , C_int ( 1 ) ,
611
608
C_int ( i as int) ) ;
612
- auto llfld = r. bcx . build . GEP ( v, vals) ;
613
- auto ty = typeck. ann_to_type ( variants. ( i) . ann ) ;
614
- r = f ( variant_cx, llfld, ty) ;
615
- r. bcx . build . Br ( next_cx. llbb ) ;
609
+ auto llvar = variant_cx. build. GEP ( v, vals) ;
610
+
611
+ auto fn_ty = typeck. ann_to_type( variants. ( i) . ann) ;
612
+ alt ( fn_ty. struct ) {
613
+ case ( typeck. ty_fn( ?args, _) ) {
614
+ auto j = 0 u;
615
+ for ( typeck. arg a in args) {
616
+ auto idx = vec( C_int ( 0 ) , C_int ( j as int) ) ;
617
+ auto llfp = variant_cx. build. GEP ( llvar,
618
+ idx) ;
619
+ auto llfld = variant_cx. build. Load ( llfp) ;
620
+ auto res = f( variant_cx, llfld, a. ty) ;
621
+ variant_cx = res. bcx;
622
+ j += 1 u;
623
+ }
624
+ }
625
+ case ( _) { fail; }
626
+ }
627
+
628
+ variant_cx. build. Br ( next_cx. llbb) ;
616
629
}
617
630
case ( nullary) {
618
631
// Nothing to do.
You can’t perform that action at this time.
0 commit comments