Skip to content

Commit b22a477

Browse files
i10416WojciechMazur
authored andcommitted
test: add test for #19762
Add a test to confirm issue#19762 is solved. [Cherry-picked 2a1d1b3]
1 parent 18e9d8f commit b22a477

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/neg/i19762.check

+6
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

+8
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)