Skip to content

Commit

Permalink
Add regression test for #17429 (#19247)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Dec 12, 2023
2 parents feed938 + c519222 commit 4336453
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/warn/i17429.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Warning: tests/warn/i17429.scala:3:17 -------------------------------------------------------------------------------
3 | println(A(1) plus A(2)) // warn
| ^^^^
| Alphanumeric method plus is not declared infix; it should not be used as infix operator.
| Instead, use method syntax .plus(...) or backticked identifier `plus`.
| The latter can be rewritten automatically under -rewrite -source 3.4-migration.
3 changes: 3 additions & 0 deletions tests/warn/i17429.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
case class A(a:Int):
def plus(a:A) = A(this.a+a.a)
println(A(1) plus A(2)) // warn

0 comments on commit 4336453

Please sign in to comment.