Skip to content

Commit 2fbc51d

Browse files
Backport "test: add test for #19762" to LTS (#20935)
Backports #19774 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents e6f6e0d + ecb75d7 commit 2fbc51d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/neg/i19762.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- [E019] Syntax Error: tests/neg/i19762.scala:8:31 --------------------------------------------------------------------
2+
8 | def combine(x: Int, y: Int)) = x + y // error
3+
| ^
4+
| Missing return type
5+
|
6+
| longer explanation available when compiling with `-explain`

tests/neg/i19762.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
trait Monoid[A]:
2+
def combine(x: A, y: A): A
3+
def empty: A
4+
5+
object Monoid:
6+
lazy val addInt: Monoid[Int] = new:
7+
val empty = 0
8+
def combine(x: Int, y: Int)) = x + y // error

0 commit comments

Comments
 (0)