Skip to content

Commit caeedcf

Browse files
oscar-striperetronym
authored andcommitted
Disable stub warning by default.
When we create a class symbols from a classpath elements, references to other classes that are absent from the classpath are represented as references to "stub symbols". This is not a fatal error; for instance if these references are from the signature of a method that isn't called from the program being compiled, we don't need to know anything about them. A subsequent attempt to look at the type of a stub symbols will trigger a compile error. Currently, the creation of a stub symbol incurs a warning. This commit removes that warning on the basis that it isn't something users need to worry about. javac doesn't emit a comparable warning. The warning is still issued under any of `-verbose` / `-Xdev` / `-Ydebug`.
1 parent 6b99dfe commit caeedcf

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ abstract class ClassfileParser {
366366
// - better owner than `NoSymbol`
367367
// - remove eager warning
368368
val msg = s"Class $name not found - continuing with a stub."
369-
if (!settings.isScaladoc) warning(msg)
369+
if ((!settings.isScaladoc) && (settings.verbose || settings.developer)) warning(msg)
370370
return NoSymbol.newStubSymbol(name.toTypeName, msg)
371371
}
372372
val completer = new loaders.ClassfileLoader(file)

test/files/run/t7439.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Recompiling after deleting t7439-run.obj/A_1.class
2-
pos: NoPosition Class A_1 not found - continuing with a stub. WARNING
2+

test/files/run/t8442.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pos: NoPosition Class A_1 not found - continuing with a stub. WARNING
1+

test/files/run/t9268.check

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Compiling Client1
2-
pos: NoPosition Class Waiter not found - continuing with a stub. WARNING
2+
33
Compiling Client2
4-
pos: NoPosition Class Waiter not found - continuing with a stub. WARNING
54
pos: NoPosition Unable to locate class corresponding to inner class entry for Predicate in owner Waiter ERROR

0 commit comments

Comments
 (0)