summaryrefslogtreecommitdiff
path: root/test/files/neg/t550.scala
blob: 5212a2658dd7d311287b73547ed1115e128c2b78 (plain) (blame)
1
2
3
4
5
6
7
8
9
abstract class Monoid[a] {
  def unit: a
}

object test {
  def sum[a](xs: List)(implicit m: Monoid[a]): a =
    if (xs.isEmpty) m.unit else xs.head
  sum(List(1,2,3))
}