File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2710,6 +2710,14 @@ fn trans_args(@block_ctxt cx,
2710
2710
}
2711
2711
if ( ty. type_has_dynamic_size( retty) ) {
2712
2712
llargs += cx. build. PointerCast ( llretslot, T_typaram_ptr ( ) ) ;
2713
+ } else if ( ty. count_ty_params( retty) != 0 u) {
2714
+ // It's possible that the callee has some generic-ness somewhere in
2715
+ // its return value -- say a method signature within an obj or a fn
2716
+ // type deep in a structure -- which the caller has a concrete view
2717
+ // of. If so, cast the caller's view of the restlot to the callee's
2718
+ // view, for the sake of making a type-compatible call.
2719
+ llargs += cx. build. PointerCast ( llretslot,
2720
+ T_ptr ( type_of( cx. fcx. ccx, retty) ) ) ;
2713
2721
} else {
2714
2722
llargs += llretslot;
2715
2723
}
You can’t perform that action at this time.
0 commit comments