summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2017-03-03 10:34:09 +0100
committerGitHub <noreply@github.com>2017-03-03 10:34:09 +0100
commitf77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe (patch)
tree828b5e90a990d04eb9cecfa3b3bf4e2ca1605a14 /src/compiler
parent96a7617eb6c90f8891eb39f20a7f41a745a8e195 (diff)
parentad13063058b3492ecaf806376b75fa206c161b4a (diff)
downloadscala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.tar.gz
scala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.tar.bz2
scala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.zip
Merge pull request #5671 from retronym/topic/stubby-2
Avoid compiler crash with missing transitive dependencies
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala5
-rw-r--r--src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala7
2 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index c1b0733895..819887f959 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -953,10 +953,11 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
definitions.isDefinitionsInitialized
&& rootMirror.isMirrorInitialized
)
- override def isPastTyper = (
+ override def isPastTyper = isPast(currentRun.typerPhase)
+ def isPast(phase: Phase) = (
(curRun ne null)
&& isGlobalInitialized // defense against init order issues
- && (globalPhase.id > currentRun.typerPhase.id)
+ && (globalPhase.id > phase.id)
)
// TODO - trim these to the absolute minimum.
diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
index dfd5b07a3b..c18f220d95 100644
--- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
+++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala
@@ -446,9 +446,10 @@ abstract class ScalaPrimitives {
inform(s"Unknown primitive method $cls.$method")
else alts foreach (s =>
addPrimitive(s,
- s.info.paramTypes match {
- case tp :: _ if code == ADD && tp =:= StringTpe => CONCAT
- case _ => code
+ if (code != ADD) code
+ else exitingTyper(s.info).paramTypes match {
+ case tp :: _ if tp =:= StringTpe => CONCAT
+ case _ => code
}
)
)