Skip to content

Commit 4336453

Browse files
authored
Add regression test for #17429 (#19247)
2 parents feed938 + c519222 commit 4336453

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/warn/i17429.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- Warning: tests/warn/i17429.scala:3:17 -------------------------------------------------------------------------------
2+
3 | println(A(1) plus A(2)) // warn
3+
| ^^^^
4+
| Alphanumeric method plus is not declared infix; it should not be used as infix operator.
5+
| Instead, use method syntax .plus(...) or backticked identifier `plus`.
6+
| The latter can be rewritten automatically under -rewrite -source 3.4-migration.

tests/warn/i17429.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
case class A(a:Int):
2+
def plus(a:A) = A(this.a+a.a)
3+
println(A(1) plus A(2)) // warn

0 commit comments

Comments
 (0)