Closed
Description
This code:
trait CtxtFn{
pub fn f9(uint) -> uint;
}
pub fn use_ctxtfn<T : CtxtFn>(cf: T) -> uint {
cf.f9(342)
}
...signals the error message:
error: type `T` does not implement any method in scope named `f9`
...which is kind of crazy, because T is bounded by CtxtFn, and I can see the definition of f9.
<before reading on: can you see the problem?>
I tore my hair out for quite a while before realizing I'd forgotten the "self" parameter on the decl of f9. This is just a papercut, but it seems like a big one to me. Fixing this--that is, signalling an error like "method f9 is declared without a self
parameter"--would presumably require a pass in resolve which scanned for methods without a self parameter.