@@ -2983,7 +2983,7 @@ type generic_info =
2983
2983
type lval_result = { bcx : @block_ctxt ,
2984
2984
val : ValueRef ,
2985
2985
is_mem : bool } ;
2986
- tag callee_env { some_env ( ValueRef ) ; null_env; is_closure; }
2986
+ tag callee_env { obj_env ( ValueRef ) ; null_env; is_closure; }
2987
2987
type lval_maybe_callee = { bcx: @block_ctxt,
2988
2988
val: ValueRef ,
2989
2989
is_mem: bool,
@@ -3191,7 +3191,7 @@ fn trans_field_inner(cx: @block_ctxt, sp: span, v: ValueRef, t0: ty::t,
3191
3191
ret_ty, 0 u) ;
3192
3192
v = Load ( r. bcx , PointerCast ( r. bcx , v, T_ptr ( T_ptr ( ll_fn_ty) ) ) ) ;
3193
3193
ret { bcx : r. bcx , val : v, is_mem : true ,
3194
- env : some_env ( r. val ) , generic : none} ;
3194
+ env : obj_env ( r. val ) , generic : none} ;
3195
3195
}
3196
3196
_ { bcx_ccx( cx) . sess . unimpl ( "field variant in trans_field" ) ; }
3197
3197
}
@@ -3342,15 +3342,15 @@ fn trans_lval(cx: @block_ctxt, e: @ast::expr) -> lval_result {
3342
3342
3343
3343
fn maybe_add_env ( bcx : @block_ctxt , c : lval_maybe_callee )
3344
3344
-> ( bool , ValueRef ) {
3345
- if c. env == is_closure {
3346
- ( c. is_mem , c. val )
3347
- } else {
3348
- let env = alt c. env {
3349
- null_env. { null_env_ptr ( bcx) }
3350
- some_env ( e) { e }
3351
- } ;
3345
+ alt c. env {
3346
+ is_closure. { ( c. is_mem , c. val ) }
3347
+ obj_env ( _) {
3348
+ fail "Taking the value of a method does not work yet (issue #435)" ;
3349
+ }
3350
+ null_env. {
3352
3351
let llfnty = llvm:: LLVMGetElementType ( val_ty ( c. val ) ) ;
3353
- ( false , create_real_fn_pair ( bcx, llfnty, c. val , env) )
3352
+ ( false , create_real_fn_pair ( bcx, llfnty, c. val , null_env_ptr ( bcx) ) )
3353
+ }
3354
3354
}
3355
3355
}
3356
3356
@@ -3904,7 +3904,7 @@ fn trans_call(in_cx: @block_ctxt, f: @ast::expr,
3904
3904
null_env. {
3905
3905
llenv = llvm:: LLVMGetUndef ( T_opaque_closure_ptr ( * bcx_ccx ( cx) ) ) ;
3906
3906
}
3907
- some_env ( e) { llenv = e; }
3907
+ obj_env ( e) { llenv = e; }
3908
3908
is_closure. {
3909
3909
// It's a closure. Have to fetch the elements
3910
3910
if f_res. is_mem { faddr = load_if_immediate ( bcx, faddr, fn_expr_ty) ; }
0 commit comments