summaryrefslogtreecommitdiff
path: root/test/files/neg/sammy_overload.scala
blob: 91c52cf96c1fbf13803024248634799c78ae01f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
trait ToString { def convert(x: Int): String }

class ExplicitSamType {
  object O {
    def m(x: Int => String): Int = 0
    def m(x: ToString): Int = 1
  }

  O.m((x: Int) => x.toString) // ok, function type takes precedence

  O.m(_.toString) // error expected: eta-conversion breaks down due to overloading
  O.m(x => x) // error expected: needs param type
}