@@ -399,13 +399,15 @@ fn type_of_fn_full(@crate_ctxt cx,
399
399
}
400
400
}
401
401
402
- // Args >3: ty params ...
403
- auto ty_param_count =
404
- ty. count_ty_params ( plain_ty ( ty. ty_fn ( inputs, output) ) ) ;
405
- auto i = 0 u;
406
- while ( i < ty_param_count) {
407
- atys += T_ptr ( T_tydesc ( ) ) ;
408
- i += 1 u;
402
+ // Args >3: ty params, if not acquired via capture...
403
+ if ( obj_self == none[ TypeRef ] ) {
404
+ auto ty_param_count =
405
+ ty. count_ty_params ( plain_ty ( ty. ty_fn ( inputs, output) ) ) ;
406
+ auto i = 0 u;
407
+ while ( i < ty_param_count) {
408
+ atys += T_ptr ( T_tydesc ( ) ) ;
409
+ i += 1 u;
410
+ }
409
411
}
410
412
411
413
// ... then explicit args.
@@ -3387,11 +3389,13 @@ fn create_llargs_for_fn_args(&@fn_ctxt cx,
3387
3389
3388
3390
auto arg_n = 3 u;
3389
3391
3390
- for ( ast. ty_param tp in ty_params) {
3391
- auto llarg = llvm. LLVMGetParam ( cx. llfn, arg_n) ;
3392
- check ( llarg as int != 0 ) ;
3393
- cx. lltydescs. insert( tp. id, llarg) ;
3394
- arg_n += 1 u;
3392
+ if ( ty_self == none[ TypeRef ] ) {
3393
+ for ( ast. ty_param tp in ty_params) {
3394
+ auto llarg = llvm. LLVMGetParam ( cx. llfn, arg_n) ;
3395
+ check ( llarg as int != 0 ) ;
3396
+ cx. lltydescs. insert( tp. id, llarg) ;
3397
+ arg_n += 1 u;
3398
+ }
3395
3399
}
3396
3400
3397
3401
0 commit comments