We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 21729d2 + 26567e7 commit 8567b73Copy full SHA for 8567b73
tests/run/i16785.check
@@ -0,0 +1 @@
1
+specific: 1
tests/run/i16785.scala
@@ -0,0 +1,14 @@
+object Test {
2
+ sealed trait Box[T] { def value: T }
3
+ final case class IntBox(value: Int) extends Box[Int]
4
+
5
+ implicit def s1[T](implicit box: Box[T]): String = "generic: " + box.value
6
+ implicit def s2(implicit box: Box[Int]): String = "specific: " + box.value
7
8
+ def test[T](implicit box: Box[T]): String = box match {
9
+ case IntBox(_) => implicitly[String]
10
+ }
11
12
+ def main(args: Array[String]): Unit =
13
+ println(test(IntBox(1)))
14
+}
0 commit comments