How do you define implicit conversion in modern way?
Stupid question, but none of the examples works for me; classic article "[Pimp my Library][1]" is buggy and even the simplest code has problems.

*Btw. I assume you have to put conversion method in the object (a lot of snippets omit that part). According to PiS book it seems hanging implicit def is OK, but this gives me error as well.*

    object Minutes
    {
      implicit def toMinutes(x : Int) = new Minutes(x)
    }
    
    class Minutes(private val x : Int)
    {
      def minutes = x.toString+"m"
    }
    
    object MainApp {
    
      def main(args : Array[String])
      {
         println(5.minutes)
         ...

The error -- "value minutes is not a member of Int".

## Question

What am I missing? Scala 2.9.1.

  [1]: http://www.artima.com/weblogs/viewpost.jsp?thread=179766

How do you define implicit conversion in modern way?
===

Stupid question, but none of the examples works for me; classic article "[Pimp my Library][1]" is buggy and even the simplest code has problems.

*Btw. I assume you have to put conversion method in the object (a lot of snippets omit that part). According to PiS book it seems hanging implicit def is OK, but this gives me error as well.*

    object Minutes
    {
      implicit def toMinutes(x : Int) = new Minutes(x)
    }
    
    class Minutes(private val x : Int)
    {
      def minutes = x.toString+"m"
    }
    
    object MainApp {
    
      def main(args : Array[String])
      {
         println(5.minutes)
         ...

The error -- "value minutes is not a member of Int".

## Question

What am I missing? Scala 2.9.1.

  [1]: http://www.artima.com/weblogs/viewpost.jsp?thread=179766
