diff --git a/tests/warn/i17429.check b/tests/warn/i17429.check new file mode 100644 index 000000000000..3496f3d6f106 --- /dev/null +++ b/tests/warn/i17429.check @@ -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. diff --git a/tests/warn/i17429.scala b/tests/warn/i17429.scala new file mode 100644 index 000000000000..4c7616303de5 --- /dev/null +++ b/tests/warn/i17429.scala @@ -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