aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/bounds.scala
blob: 556955877c758a116d3e1587973f0c7689096f22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
object Test {
  def g[B >: String <: Int](x: B): Int = x
  def main(args: Array[String]): Unit = {
    g("foo") // error: Type argument String' does not conform to upper bound Int
  }
  def baz[X >: Y, Y <: String](x: X, y: Y) = (x, y)

  baz[Int, String](1, "abc") // error: Type argument Int does not conform to lower bound Y

}