Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
SO-analysis
% cat sandbox/test1.scala
package test
sealed trait A[T]
object A {
implicit object AInt extends A[Int]
implicit object AString extends A[String]
}
% cat sandbox/test.scala
package test
object Bar{
def foo[T : A](b: T) = println(b)
def main(args: Array[String]) {
foo(3)
}
}
% scalac210 -version
Scala code runner version 2.10.3 -- Copyright 2002-2012, LAMP/EPFL
% scalac210 sandbox/test.scala sandbox/test1.scala
% scalac210 sandbox/test1.scala sandbox/test.scala
% scalac210 sandbox/test1.scala && scalac210 sandbox/test.scala
@afwlehmann
% cat test/test.scala
package test

object Bar {
  def foo[T: A](b: T) = println(b)
  def main(args: Array[String]) {
    foo(3)
  }
}

sealed trait A[T]

object A {
  implicit object AInt extends A[Int]
  implicit object AString extends A[String]
}

% scalac -version
Scala compiler version 2.10.3 -- Copyright 2002-2013, LAMP/EPFL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.