Skip to content

Commit 0632405

Browse files
authored
Merge pull request #15489 from dotty-staging/fix-15479
Do cross version checks on import qualifiers
2 parents db45462 + 449044a commit 0632405

File tree

83 files changed

+116
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+116
-93
lines changed

bench/src/main/scala/Benchmarks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import org.openjdk.jmh.results.format._
1515
import java.util.concurrent.TimeUnit
1616

1717
import java.io.{File, FileOutputStream, BufferedWriter, FileWriter}
18-
import scala.collection.JavaConverters._
18+
import scala.jdk.CollectionConverters._
1919
import scala.io.Source
2020
import scala.util.Using
2121

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
2222

2323
/** Executes shell command, returns false in case of error. */
2424
def exec(projectDir: Path, binary: String, arguments: Seq[String], environment: Map[String, String]): Int =
25-
import collection.JavaConverters._
25+
import scala.jdk.CollectionConverters._
2626
val command = binary +: arguments
2727
log(command.mkString(" "))
2828
val builder = new ProcessBuilder(command: _*).directory(projectDir.toFile).inheritIO()

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import dotty.tools.dotc.ast.tpd
88
import dotty.tools.dotc.core.Phases.Phase
99

1010
import scala.collection.mutable
11-
import scala.collection.JavaConverters._
11+
import scala.jdk.CollectionConverters._
1212
import dotty.tools.dotc.transform.SymUtils._
1313
import dotty.tools.dotc.interfaces
1414
import dotty.tools.dotc.report
@@ -605,13 +605,13 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
605605
// Statistics.stopTimer(BackendStats.bcodeWriteTimer, writeStart)
606606
catch
607607
case e: MethodTooLargeException =>
608-
val method =
608+
val method =
609609
s"${e.getClassName.replaceAll("/", ".")}.${e.getMethodName}"
610-
val msg =
611-
s"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
610+
val msg =
611+
s"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
612612
report.error(msg)
613613
case e: ClassTooLargeException =>
614-
val msg =
614+
val msg =
615615
s"Class '${e.getClassName.replaceAll("/", ".")}' is too large. Constant pool size: ${e.getConstantPoolCount}. Limit is 64K entries"
616616
report.error(msg)
617617

compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotty.tools.io.{AbstractFile, PlainFile, ClassPath, ClassRepresentation,
1414
import FileUtils._
1515
import PlainFile.toPlainFile
1616

17-
import scala.collection.JavaConverters._
17+
import scala.jdk.CollectionConverters._
1818
import scala.collection.immutable.ArraySeq
1919
import scala.util.control.NonFatal
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.annotation.tailrec
44
import scala.collection.mutable.ArrayBuffer
55
import java.lang.Character.isWhitespace
66
import java.nio.file.{Files, Paths}
7-
import scala.collection.JavaConverters._
7+
import scala.jdk.CollectionConverters._
88

99
/** A simple enough command line parser.
1010
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait WrappedProperties extends PropertiesTrait {
2222
override def envOrNone(name: String): Option[String] = wrap(super.envOrNone(name)).flatten
2323

2424
def systemProperties: Iterator[(String, String)] = {
25-
import scala.collection.JavaConverters._
25+
import scala.jdk.CollectionConverters._
2626
wrap(System.getProperties.asScala.iterator) getOrElse Iterator.empty
2727
}
2828
}

compiler/src/dotty/tools/dotc/profile/Profiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private [profile] object NoOpProfiler extends Profiler {
8181
override def finished(): Unit = ()
8282
}
8383
private [profile] object RealProfiler {
84-
import scala.collection.JavaConverters._
84+
import scala.jdk.CollectionConverters._
8585
val runtimeMx: RuntimeMXBean = ManagementFactory.getRuntimeMXBean
8686
val memoryMx: MemoryMXBean = ManagementFactory.getMemoryMXBean
8787
val gcMx: List[GarbageCollectorMXBean] = ManagementFactory.getGarbageCollectorMXBeans.asScala.toList

compiler/src/dotty/tools/dotc/semanticdb/Tools.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc.semanticdb
22

33
import java.nio.file._
44
import java.nio.charset.StandardCharsets
5-
import scala.collection.JavaConverters._
5+
import scala.jdk.CollectionConverters._
66
import dotty.tools.dotc.util.SourceFile
77
import dotty.tools.dotc.semanticdb.Scala3.given
88

compiler/src/dotty/tools/dotc/transform/FirstTransform.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase =>
138138
}
139139

140140
override def transformOther(tree: Tree)(using Context): Tree = tree match {
141-
case tree: Import if untpd.languageImport(tree.expr).isEmpty => EmptyTree
142141
case tree: Export => EmptyTree
143142
case tree: NamedArg => transformAllDeep(tree.arg)
144143
case tree => if (tree.isType) toTypeTree(tree) else tree

0 commit comments

Comments
 (0)