diff --git a/tests/neg/i19762.check b/tests/neg/i19762.check new file mode 100644 index 000000000000..93def936e2a0 --- /dev/null +++ b/tests/neg/i19762.check @@ -0,0 +1,6 @@ +-- [E019] Syntax Error: tests/neg/i19762.scala:8:31 -------------------------------------------------------------------- +8 | def combine(x: Int, y: Int)) = x + y // error + | ^ + | Missing return type + | + | longer explanation available when compiling with `-explain` diff --git a/tests/neg/i19762.scala b/tests/neg/i19762.scala new file mode 100644 index 000000000000..4966f0d8cb53 --- /dev/null +++ b/tests/neg/i19762.scala @@ -0,0 +1,8 @@ +trait Monoid[A]: + def combine(x: A, y: A): A + def empty: A + +object Monoid: + lazy val addInt: Monoid[Int] = new: + val empty = 0 + def combine(x: Int, y: Int)) = x + y // error \ No newline at end of file