Skip to content

Commit 3f31e08

Browse files
noti0na1WojciechMazur
authored andcommitted
Exclude exported symbols
[Cherry-picked 77dae85]
1 parent 2c20198 commit 3f31e08

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2961,7 +2961,7 @@ object SymDenotations {
29612961
dependent = null
29622962
}
29632963

2964-
protected def addDependent(dep: InheritedCache) = {
2964+
protected def addDependent(dep: InheritedCache): Unit = {
29652965
if (dependent == null) dependent = new WeakHashMap
29662966
dependent.nn.put(dep, ())
29672967
}

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ object RefChecks {
11891189
def checkPublicFlexibleTypes(sym: Symbol)(using Context): Unit =
11901190
if ctx.explicitNulls && !ctx.isJava
11911191
&& sym.exists && !sym.is(Private) && sym.owner.isClass
1192-
&& !sym.isOneOf(Synthetic | InlineProxy | Param) then
1192+
&& !sym.isOneOf(Synthetic | InlineProxy | Param | Exported) then
11931193
val resTp = sym.info.finalResultType
11941194
if resTp.existsPart(_.isInstanceOf[FlexibleType], StopAt.Static) then
11951195
report.warning(

compiler/src/dotty/tools/repl/AbstractFileClassLoader.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader) exten
2626
// on JDK 20 the URL constructor we're using is deprecated,
2727
// but the recommended replacement, URL.of, doesn't exist on JDK 8
2828
@annotation.nowarn("cat=deprecation")
29-
override protected def findResource(name: String) =
29+
override protected def findResource(name: String): URL | Null =
3030
findAbstractFile(name) match
3131
case null => null
3232
case file => new URL(null, s"memory:${file.path}", new URLStreamHandler {
@@ -35,13 +35,13 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader) exten
3535
override def getInputStream = file.input
3636
}
3737
})
38-
override protected def findResources(name: String) =
38+
override protected def findResources(name: String): java.util.Enumeration[URL] =
3939
findResource(name) match
4040
case null => Collections.enumeration(Collections.emptyList[URL]) //Collections.emptyEnumeration[URL]
4141
case url => Collections.enumeration(Collections.singleton(url))
4242

4343
override def findClass(name: String): Class[?] = {
44-
var file: AbstractFile = root
44+
var file: AbstractFile | Null = root
4545
val pathParts = name.split("[./]").toList
4646
for (dirPart <- pathParts.init) {
4747
file = file.lookupName(dirPart, true)

0 commit comments

Comments
 (0)