@@ -82,10 +82,12 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
82
82
def findMemberFromRoot (fullName : Name ): Symbol = rootMirror.findMemberFromRoot(fullName)
83
83
84
84
override def openPackageModule (pkgClass : Symbol , force : Boolean ): Unit = {
85
- if (force || isPast(currentRun.namerPhase)) super .openPackageModule(pkgClass, force = true )
85
+ // presentation compiler uses `compileLate` whioch doesn't advance `globalPhase`, so `isPast` is false.
86
+ // therefore checking `isAtPhaseAfter` as well.
87
+ val forceNow = force || isPast(currentRun.namerPhase) || isRunGlobalInitialized && isAtPhaseAfter(currentRun.namerPhase)
88
+ if (forceNow) super .openPackageModule(pkgClass, force = true )
86
89
else analyzer.packageObjects.deferredOpen.addOne(pkgClass)
87
90
}
88
-
89
91
// alternate constructors ------------------------------------------
90
92
91
93
override def settings = currentSettings
@@ -1037,25 +1039,16 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
1037
1039
private [this ] var curFreshNameCreator : FreshNameCreator = null
1038
1040
private [scala] def currentFreshNameCreator_= (fresh : FreshNameCreator ): Unit = curFreshNameCreator = fresh
1039
1041
1040
- def isGlobalInitialized = (
1041
- definitions.isDefinitionsInitialized
1042
- && rootMirror.isMirrorInitialized
1043
- )
1042
+ def isGlobalInitialized = definitions.isDefinitionsInitialized && rootMirror.isMirrorInitialized
1043
+ private def isRunGlobalInitialized = (curRun ne null ) && isGlobalInitialized
1044
+
1044
1045
override def isPastTyper = isPast(currentRun.typerPhase)
1045
1046
def isBeforeErasure = isBefore(currentRun.erasurePhase)
1046
- def isPast (phase : Phase ) = (
1047
- (curRun ne null )
1048
- && isGlobalInitialized // defense against init order issues
1049
- && (globalPhase.id > phase.id)
1050
- )
1051
- def isBefore (phase : Phase ) = (
1052
- (curRun ne null )
1053
- && isGlobalInitialized // defense against init order issues
1054
- && (phase match {
1055
- case NoPhase => true // if phase is NoPhase then that phase ain't comin', so we're "before it"
1056
- case _ => globalPhase.id < phase.id
1057
- })
1058
- )
1047
+ def isPast (phase : Phase ) = isRunGlobalInitialized && (globalPhase.id > phase.id)
1048
+ def isBefore (phase : Phase ) = isRunGlobalInitialized && (phase match {
1049
+ case NoPhase => true // if phase is NoPhase then that phase ain't comin', so we're "before it"
1050
+ case _ => globalPhase.id < phase.id
1051
+ })
1059
1052
1060
1053
// TODO - trim these to the absolute minimum.
1061
1054
@ inline final def exitingErasure [T ](op : => T ): T = exitingPhase(currentRun.erasurePhase)(op)
0 commit comments