@@ -28,7 +28,8 @@ import util.Chars
28
28
import scala .annotation .{tailrec , switch }
29
29
import rewrites .Rewrites .{patch , overlapsPatch }
30
30
import reporting ._
31
- import config .Feature .{sourceVersion , migrateTo3 , dependentEnabled , symbolLiteralsEnabled }
31
+ import config .Feature
32
+ import config .Feature .{sourceVersion , migrateTo3 }
32
33
import config .SourceVersion ._
33
34
import config .SourceVersion
34
35
@@ -590,6 +591,8 @@ object Parsers {
590
591
if in.currentRegion.indentWidth < nextIndentWidth then
591
592
warning(i " Line is indented too far to the right, or a `{` or `:` is missing " , in.next.offset)
592
593
594
+ def featureEnabled (name : TermName ) = Feature .enabled(name)(using languageImportContext)
595
+
593
596
/* -------- REWRITES ----------------------------------------------------------- */
594
597
595
598
/** The last offset where a colon at the end of line would be required if a subsequent { ... }
@@ -1141,7 +1144,7 @@ object Parsers {
1141
1144
Quote (t)
1142
1145
}
1143
1146
else
1144
- if ! symbolLiteralsEnabled( using languageImportContext ) then
1147
+ if ! featureEnabled( Feature .symbolLiterals ) then
1145
1148
report.errorOrMigrationWarning(
1146
1149
em """ symbol literal ' ${in.name} is no longer supported,
1147
1150
|use a string literal " ${in.name}" or an application Symbol(" ${in.name}") instead,
@@ -1572,7 +1575,7 @@ object Parsers {
1572
1575
typeIdent()
1573
1576
else
1574
1577
def singletonArgs (t : Tree ): Tree =
1575
- if in.token == LPAREN && dependentEnabled( using languageImportContext )
1578
+ if in.token == LPAREN && featureEnabled( Feature .dependent )
1576
1579
then singletonArgs(AppliedTypeTree (t, inParens(commaSeparated(singleton))))
1577
1580
else t
1578
1581
singletonArgs(simpleType1())
0 commit comments