Skip to content

Commit 81bf077

Browse files
committed
Clean up imports
Honor the new scheme where any explicit import of a root import will disable the root import.
1 parent 9ddeb13 commit 81bf077

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Trees {
3232
/** Property key for trees with documentation strings attached */
3333
val DocComment = new Property.Key[Comment]
3434

35-
@sharable private var nextId = 0 // for debugging
35+
@sharable private var nextId = 0 // for debugging
3636

3737
type LazyTree = AnyRef /* really: Tree | Lazy[Tree] */
3838
type LazyTreeList = AnyRef /* really: List[Tree] | Lazy[List[Tree]] */
@@ -60,18 +60,18 @@ object Trees {
6060
with Cloneable {
6161

6262
if (Stats.enabled) ntrees += 1
63-
63+
6464
private def nxId = {
6565
nextId += 1
6666
//assert(nextId != 199, this)
67-
nextId
67+
nextId
6868
}
6969

7070
/** A unique identifier for this tree. Used for debugging, and potentially
7171
* tracking presentation compiler interactions
7272
*/
7373
private var myUniqueId: Int = nxId
74-
74+
7575
def uniqueId = myUniqueId
7676

7777
/** The type constructor at the root of the tree */
@@ -192,7 +192,7 @@ object Trees {
192192

193193
override def hashCode(): Int = uniqueId // for debugging; was: System.identityHashCode(this)
194194
override def equals(that: Any) = this eq that.asInstanceOf[AnyRef]
195-
195+
196196
override def clone: Tree[T] = {
197197
val tree = super.clone.asInstanceOf[Tree[T]]
198198
tree.myUniqueId = nxId

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@ object Types {
25242524
case _: MethodType => true
25252525
case _ => false
25262526
}
2527-
2527+
25282528
/** Is this polytype a higher-kinded type lambda as opposed to a polymorphic?
25292529
* method type? Only type lambdas get created with variances, that's how we can tell.
25302530
*/

src/dotty/tools/dotc/repl/CompilingInterpreter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.io.{
66
File, PrintWriter, PrintStream, StringWriter, Writer, OutputStream,
77
ByteArrayOutputStream => ByteOutputStream
88
}
9-
import java.lang.{Class, ClassLoader}
9+
import java.lang.{Class, ClassLoader, Thread, System, StringBuffer}
1010
import java.net.{URL, URLClassLoader}
1111

1212
import scala.collection.immutable.ListSet

src/dotty/tools/dotc/repl/InterpreterLoop.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package repl
44

55
import java.io.{BufferedReader, File, FileReader, PrintWriter}
66
import java.io.IOException
7-
import java.lang.{ClassLoader, System}
7+
import java.lang.{ClassLoader, System, Thread}
88
import scala.concurrent.{Future, Await}
99
import scala.concurrent.duration.Duration
1010
import reporting.Reporter

src/dotty/tools/dotc/transform/CollectEntryPoints.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import dotty.tools.dotc.core.Symbols.NoSymbol
99
import scala.annotation.tailrec
1010
import dotty.tools.dotc.core._
1111
import Symbols._
12-
import scala.Some
1312
import dotty.tools.dotc.transform.TreeTransforms.{NXTransformations, TransformerInfo, TreeTransform, TreeTransformer}
1413
import dotty.tools.dotc.ast.tpd
1514
import dotty.tools.dotc.core.Contexts.Context

src/dotty/tools/dotc/util/Chars.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package dotty.tools.dotc
66
package util
77

88
import scala.annotation.switch
9-
import java.lang.{ Character => JCharacter }
109
import java.lang.{Character => JCharacter}
1110
import java.lang.Character.LETTER_NUMBER
1211
import java.lang.Character.LOWERCASE_LETTER
@@ -66,16 +65,16 @@ object Chars {
6665

6766
/** Can character start an alphanumeric Scala identifier? */
6867
def isIdentifierStart(c: Char): Boolean =
69-
(c == '_') || (c == '$') || Character.isUnicodeIdentifierStart(c)
68+
(c == '_') || (c == '$') || JCharacter.isUnicodeIdentifierStart(c)
7069

7170
/** Can character form part of an alphanumeric Scala identifier? */
7271
def isIdentifierPart(c: Char) =
73-
(c == '$') || Character.isUnicodeIdentifierPart(c)
72+
(c == '$') || JCharacter.isUnicodeIdentifierPart(c)
7473

7574
/** Is character a math or other symbol in Unicode? */
7675
def isSpecial(c: Char) = {
77-
val chtp = Character.getType(c)
78-
chtp == Character.MATH_SYMBOL.toInt || chtp == Character.OTHER_SYMBOL.toInt
76+
val chtp = JCharacter.getType(c)
77+
chtp == JCharacter.MATH_SYMBOL.toInt || chtp == JCharacter.OTHER_SYMBOL.toInt
7978
}
8079

8180
private final val otherLetters = Set[Char]('\u0024', '\u005F') // '$' and '_'

0 commit comments

Comments
 (0)