Skip to content

Commit 740ac67

Browse files
committed
Drop language.postfixOps as a default option in build and test
1 parent 47760c4 commit 740ac67

20 files changed

+44
-26
lines changed

compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ trait BytecodeWriters {
100100
super.writeClass(label, jclassName, jclassBytes, outfile)
101101

102102
val segments = jclassName.split("[./]")
103-
val asmpFile = segments.foldLeft(baseDir: Path)(_ / _) changeExtension "asmp" toFile;
103+
val asmpFile = segments.foldLeft(baseDir: Path)(_ / _).changeExtension("asmp").toFile
104104

105105
asmpFile.parent.createDirectory()
106106
emitAsmp(jclassBytes, asmpFile)
@@ -131,7 +131,7 @@ trait BytecodeWriters {
131131
super.writeClass(label, jclassName, jclassBytes, outfile)
132132

133133
val pathName = jclassName
134-
val dumpFile = pathName.split("[./]").foldLeft(baseDir: Path) (_ / _) changeExtension "class" toFile;
134+
val dumpFile = pathName.split("[./]").foldLeft(baseDir: Path) (_ / _).changeExtension("class").toFile
135135
dumpFile.parent.createDirectory()
136136
val outstream = new DataOutputStream(new FileOutputStream(dumpFile.path))
137137

compiler/src/dotty/tools/dotc/config/PathResolver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object PathResolver {
3030
def ppcp(s: String): String = split(s) match {
3131
case Nil => ""
3232
case Seq(x) => x
33-
case xs => xs map ("\n" + _) mkString
33+
case xs => xs.map("\n" + _).mkString
3434
}
3535

3636
/** Values found solely by inspecting environment or property variables.

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class CompilationTests {
5858
compileFile("tests/pos-special/kind-projector.scala", defaultOptions.and("-Ykind-projector")),
5959
compileFile("tests/pos-special/kind-projector-underscores.scala", defaultOptions.and("-Ykind-projector:underscores")),
6060
compileFile("tests/run/i5606.scala", defaultOptions.and("-Yretain-trees")),
61-
compileFile("tests/pos-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"),
6261
compileFile("tests/pos-custom-args/i8875.scala", defaultOptions.and("-Xprint:getters")),
6362
compileFile("tests/pos-custom-args/i9267.scala", defaultOptions.and("-Ystop-after:erasure")),
6463
compileFile("tests/pos-special/extend-java-enum.scala", defaultOptions.and("-source", "3.0-migration")),
@@ -180,7 +179,6 @@ class CompilationTests {
180179
compileFile("tests/neg-custom-args/kind-projector.scala", defaultOptions.and("-Ykind-projector")),
181180
compileFile("tests/neg-custom-args/kind-projector-underscores.scala", defaultOptions.and("-Ykind-projector:underscores")),
182181
compileFile("tests/neg-custom-args/typeclass-derivation2.scala", defaultOptions.and("-language:experimental.erasedDefinitions")),
183-
compileFile("tests/neg-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"),
184182
compileFile("tests/neg-custom-args/deptypes.scala", defaultOptions.and("-language:experimental.dependent")),
185183
compileFile("tests/neg-custom-args/matchable.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),
186184
compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object TestConfiguration {
6262

6363
val yCheckOptions = Array("-Ycheck:all")
6464

65-
val commonOptions = Array("-indent", "-language:postfixOps") ++ checkOptions ++ noCheckOptions ++ yCheckOptions
65+
val commonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions
6666
val defaultOptions = TestFlags(basicClasspath, commonOptions)
6767
val unindentOptions = TestFlags(basicClasspath, Array("-no-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions)
6868
val withCompilerOptions =

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ object Build {
170170
"-unchecked",
171171
"-Xfatal-warnings",
172172
"-encoding", "UTF8",
173-
"-language:existentials,higherKinds,implicitConversions,postfixOps"
173+
"-language:existentials,higherKinds,implicitConversions"
174174
),
175175

176176
(Compile / compile / javacOptions) ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),

tests/neg/i12361.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import language.postfixOps
12
object Test {
23
foo = macro Impls . foo [ U ] += // error // error
34
}

tests/neg/i14564.check

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- [E018] Syntax Error: tests/neg/i14564.scala:5:28 --------------------------------------------------------------------
2+
5 |def test = sum"${ List(42)* }" // error // error
3+
| ^
4+
| expression expected but '}' found
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E008] Not Found Error: tests/neg/i14564.scala:5:26 -----------------------------------------------------------------
8+
5 |def test = sum"${ List(42)* }" // error // error
9+
| ^^^^^^^^^
10+
| value * is not a member of List[Int], but could be made available as an extension method.
11+
|
12+
| One of the following imports might make progress towards fixing the problem:
13+
|
14+
| import math.Fractional.Implicits.infixFractionalOps
15+
| import math.Integral.Implicits.infixIntegralOps
16+
| import math.Numeric.Implicits.infixNumericOps
17+
|

tests/neg/i14564.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import language.postfixOps as _
2+
3+
extension (sc: StringContext) def sum(xs: Int*): String = xs.sum.toString
4+
5+
def test = sum"${ List(42)* }" // error // error
6+

tests/neg/i1672.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
class Test {
33
implicit def compareComparables[T](x: T)(implicit ord: Ordering[T]) = // error: result type of implicit definition needs to be given explicitly
44
new ord.OrderingOps(x)
5-
class Bippy { def compare(y: Bippy) = util Random }
5+
class Bippy { def compare(y: Bippy) = util.Random }
66
() < () // error: value `<` is not a member of Unit
77
}

tests/neg/i1707.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import language.postfixOps
12
object DepBug {
23
class A {
34
class B

0 commit comments

Comments
 (0)