Skip to content

Commit 99db4d2

Browse files
committed
Change asInstanceOf to nullable type; remove some .nn
1 parent fbd1eeb commit 99db4d2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with No
214214
final class CtSymClassPath(ctSym: java.nio.file.Path, release: Int) extends ClassPath with NoSourcePaths {
215215
import java.nio.file.Path, java.nio.file.*
216216

217-
private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null.asInstanceOf[ClassLoader])
217+
private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null: ClassLoader | Null)
218218
private val root: Path = fileSystem.getRootDirectories.iterator.next
219219
private val roots = Files.newDirectoryStream(root).iterator.asScala.toList
220220

compiler/src/dotty/tools/dotc/core/StdNames.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ object StdNames {
4141
inline val Product = "Product"
4242

4343
@sharable
44-
private val disallowed = java.util.regex.Pattern.compile("""[<>]""").nn
45-
def sanitize(str: String): String = disallowed.matcher(str).replaceAll("""\$""").nn
44+
private val disallowed = java.util.regex.Pattern.compile("""[<>]""")
45+
def sanitize(str: String): String = disallowed.matcher(str).replaceAll("""\$""")
4646
}
4747

4848
abstract class DefinedNames[N <: Name] {

0 commit comments

Comments
 (0)