Skip to content

Commit

Permalink
test: add test for #19762
Browse files Browse the repository at this point in the history
Add a test to confirm issue#19762 is solved.
  • Loading branch information
i10416 committed Feb 24, 2024
1 parent 8e2f92a commit 2a1d1b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/neg/i19762.check
Original file line number Diff line number Diff line change
@@ -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`
8 changes: 8 additions & 0 deletions tests/neg/i19762.scala
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2a1d1b3

Please sign in to comment.