aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/implicits1.scala
blob: 4eae69325da1d01dda765e0e30ae3e1ebb2ad453 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class X(elem: Int) extends Object

object Implicits {

  implicit val impl: X = new X(0)

  implicit def conv(x: Int): X = new X(x)

  val a: Object = "abc"
  val b: Any = "abc"

  def foo(x: Int)(implicit y: X): Int = {
    println(y)
    x
  }

  val y: Int = foo(1)

  val z: X = 3

}