Closed
Description
% rustc -v
rustc 0.6 (77ee858 2013-02-02 11:54:29 +0100)
host: x86_64-apple-darwin
% cat bug3.rs
pub trait Op<T> { fn call(self, T,T) -> T; }
impl<T> fn(T,T) -> T : Op<T> {
fn call(self, a:T, b:T) -> T { self(a,b) }
}
fn square<T : Copy>(x:T, op:Op<T>) -> T { op.call(x, x) }
fn main() {
let r = square(3, (|x:int,y:int|x*y) as Op::<int>); io::println(fmt!("%d", r))
}
% rustc bug3.rs
error: internal compiler error: methods with by-value self should not be called on objects