File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed
compiler/src/dotty/tools/dotc/parsing
neg-custom-args/fatal-warnings Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2169,11 +2169,11 @@ object Parsers {
2169
2169
// Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... "
2170
2170
// is not supported by Scala2.x
2171
2171
report.errorOrMigrationWarning(
2172
- s " This syntax is no longer supported; parameter needs to be enclosed in (...) " ,
2173
- in.sourcePos( ))
2172
+ s " This syntax is no longer supported; parameter needs to be enclosed in (...) ${rewriteNotice()} " ,
2173
+ source.atSpan( Span (start, in.lastOffset) ))
2174
2174
in.nextToken()
2175
2175
val t = infixType()
2176
- if (false && migrateTo3 ) {
2176
+ if (sourceVersion == `3.1-migration` ) {
2177
2177
patch(source, Span (start), " (" )
2178
2178
patch(source, Span (in.lastOffset), " )" )
2179
2179
}
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg-custom-args/fatal-warnings/i9266.scala:3:22 --------------------------------------------------------
2
+ 3 |def test = { implicit x: Int => x + x } // error
3
+ | ^
4
+ | This syntax is no longer supported; parameter needs to be enclosed in (...)
5
+ | This construct can be rewritten automatically under -rewrite.
Original file line number Diff line number Diff line change
1
+ import language .`3.1-migration`
2
+
3
+ def test = { implicit x : Int => x + x } // error
Original file line number Diff line number Diff line change
1
+ import language .`3.1-migration`
2
+
3
+ def test = { implicit x : Int => x + x }
You can’t perform that action at this time.
0 commit comments