summaryrefslogtreecommitdiff
path: root/test/files/neg/t6889.scala
blob: 3fc235bf7e567294e350c40ef75e1dd6c1a58aee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package bippy {
  trait Bippy[A] extends Any
}
package foo {
  package object unrelated {
    implicit def bippyDingo[A](x: bippy.Bippy[A]): AnyRef = Nil
  }
  package unrelated {
    trait Unrelated
  }
}

object Test {
  trait Dingo extends Any with bippy.Bippy[foo.unrelated.Unrelated]

  def f(x: Dingo): AnyRef = x   // fail - no conversion to AnyRef
  def f2(x: Dingo): Object = x   // fail - no conversion to Object
  var x: Int = null             // fail - no conversion from Null
}