summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOscar Boykin <oscar@stripe.com>2016-07-07 10:19:55 -1000
committerjvican <jorgevc@fastmail.es>2017-03-25 14:18:15 +0100
commit9cfa239e776c2ce6bd7447fd9de8436c5fe167ab (patch)
tree2f629f7e8cd6bc22bf839516e36a9d631e9351b9
parent61a6f3edf794a498b51d05febc01feccaa7d3f67 (diff)
downloadscala-9cfa239e776c2ce6bd7447fd9de8436c5fe167ab.tar.gz
scala-9cfa239e776c2ce6bd7447fd9de8436c5fe167ab.tar.bz2
scala-9cfa239e776c2ce6bd7447fd9de8436c5fe167ab.zip
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`.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala2
-rw-r--r--test/files/run/t7439.check2
-rw-r--r--test/files/run/t8442.check2
-rw-r--r--test/files/run/t9268.check3
4 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index e51877225f..809effe18b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -366,7 +366,7 @@ abstract class ClassfileParser {
// - better owner than `NoSymbol`
// - remove eager warning
val msg = s"Class $name not found - continuing with a stub."
- if (!settings.isScaladoc) warning(msg)
+ if ((!settings.isScaladoc) && (settings.verbose || settings.developer)) warning(msg)
return NoSymbol.newStubSymbol(name.toTypeName, msg)
}
val completer = new loaders.ClassfileLoader(file)
diff --git a/test/files/run/t7439.check b/test/files/run/t7439.check
index 9ea09f9c40..b95884311a 100644
--- a/test/files/run/t7439.check
+++ b/test/files/run/t7439.check
@@ -1,2 +1,2 @@
Recompiling after deleting t7439-run.obj/A_1.class
-pos: NoPosition Class A_1 not found - continuing with a stub. WARNING
+
diff --git a/test/files/run/t8442.check b/test/files/run/t8442.check
index ce9e8b52ff..8b13789179 100644
--- a/test/files/run/t8442.check
+++ b/test/files/run/t8442.check
@@ -1 +1 @@
-pos: NoPosition Class A_1 not found - continuing with a stub. WARNING
+
diff --git a/test/files/run/t9268.check b/test/files/run/t9268.check
index 90ef940eb3..60afcbb648 100644
--- a/test/files/run/t9268.check
+++ b/test/files/run/t9268.check
@@ -1,5 +1,4 @@
Compiling Client1
-pos: NoPosition Class Waiter not found - continuing with a stub. WARNING
+
Compiling Client2
-pos: NoPosition Class Waiter not found - continuing with a stub. WARNING
pos: NoPosition Unable to locate class corresponding to inner class entry for Predicate in owner Waiter ERROR