1

I was experimenting with continuations, and I came across a case that seems to suggest that @cpsParam thwarts implicit conversions.

I have

def v: T @cpsParam[Unit, Unit]
// ...and then later
v must_== 42
// where must_== is from specs/mockito

I get the compiler error:

must_== is not a member of Int @cpsParam[Unit,Unit]

A more complete code sample is available on gist.

Is there a simple mistake I've made?

Thanks, Topher.

Topher
  • 76
  • 6

1 Answers1

0

I can't find where must_== method is defined. But you should probably import the implicit conversion method and not only the class/trait/object. It means, you should write something like this:

import foo.bar.Bar.convert // OK

or this:

import foo.bar.Bar._ // OK

and not this

import foo.bar.Bar // Bad: The implicit conversion method is not imported!

v6ak
  • 1,636
  • 2
  • 12
  • 27
  • The example code on gist brings the necessary implicit defs into scope through the traits/classes it extends. – Topher Feb 28 '11 at 13:23