Skip to content

Commit 4c534f4

Browse files
Florian3kjchyb
authored andcommitted
Apply review suggestions
1 parent bb3656d commit 4c534f4

34 files changed

+104
-84
lines changed

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class GenBCode extends Phase { self =>
1717

1818
override def description: String = GenBCode.description
1919

20-
override def isRunnable(using Context) = super.isRunnable && !ctx.usesBestEffortTasty
20+
override def isRunnable(using Context) = super.isRunnable && !ctx.usedBestEffortTasty
2121

2222
private val superCallsMap = new MutableSymbolMap[Set[ClassSymbol]]
2323
def registerSuperCall(sym: Symbol, calls: ClassSymbol): Unit = {

compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GenSJSIR extends Phase {
1212
override def description: String = GenSJSIR.description
1313

1414
override def isRunnable(using Context): Boolean =
15-
super.isRunnable && ctx.settings.scalajs.value && !ctx.usesBestEffortTasty
15+
super.isRunnable && ctx.settings.scalajs.value && !ctx.usedBestEffortTasty
1616

1717
def run(using Context): Unit =
1818
new JSCodeGen().run()

compiler/src/dotty/tools/dotc/Driver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Driver {
3939
catch
4040
case ex: FatalError =>
4141
report.error(ex.getMessage.nn) // signals that we should fail compilation.
42-
case ex: Throwable if ctx.usesBestEffortTasty =>
42+
case ex: Throwable if ctx.usedBestEffortTasty =>
4343
report.bestEffortError(ex, "Some best-effort tasty files were not able to be read.")
4444
case ex: TypeError if !runOrNull.enrichedErrorMessage =>
4545
println(runOrNull.enrichErrorMessage(s"${ex.toMessage} while compiling ${files.map(_.path).mkString(", ")}"))

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,6 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
301301
ctx.settings.Yskip.value, ctx.settings.YstopBefore.value, stopAfter, ctx.settings.Ycheck.value)
302302
ctx.base.usePhases(phases, runCtx)
303303

304-
var forceReachPhaseMaybe =
305-
if (ctx.isBestEffort && phases.exists(_.phaseName == "typer")) Some("typer")
306-
else None
307-
308304
if ctx.settings.YnoDoubleBindings.value then
309305
ctx.base.checkNoDoubleBindings = true
310306

@@ -313,6 +309,10 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
313309
val profiler = ctx.profiler
314310
var phasesWereAdjusted = false
315311

312+
var forceReachPhaseMaybe =
313+
if (ctx.isBestEffort && phases.exists(_.phaseName == "typer")) Some("typer")
314+
else None
315+
316316
for phase <- allPhases do
317317
doEnterPhase(phase)
318318
val phaseWillRun = phase.isRunnable || forceReachPhaseMaybe.nonEmpty
@@ -329,11 +329,8 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
329329
ctx.fresh.setPhase(phase.next).setCompilationUnit(unit))
330330
lastPrintedTree = printTree(lastPrintedTree)(using printCtx(unit))
331331

332-
forceReachPhaseMaybe match {
333-
case Some(forceReachPhase) if phase.phaseName == forceReachPhase =>
334-
forceReachPhaseMaybe = None
335-
case _ =>
336-
}
332+
if forceReachPhaseMaybe.contains(phase.phaseName) then
333+
forceReachPhaseMaybe = None
337334

338335
report.informTime(s"$phase ", start)
339336
Stats.record(s"total trees at end of $phase", ast.Trees.ntrees)

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
4747
case _: RefTree | _: GenericApply | _: Inlined | _: Hole =>
4848
ta.assignType(untpd.Apply(fn, args), fn, args)
4949
case _ =>
50-
assert(ctx.isBestEffort || ctx.usesBestEffortTasty || ctx.reporter.errorsReported)
50+
assert(ctx.reporter.errorsReported || ctx.tolerateErrorsForBestEffort)
5151
ta.assignType(untpd.Apply(fn, args), fn, args)
5252

5353
def TypeApply(fn: Tree, args: List[Tree])(using Context): TypeApply = fn match
@@ -56,7 +56,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
5656
case _: RefTree | _: GenericApply =>
5757
ta.assignType(untpd.TypeApply(fn, args), fn, args)
5858
case _ =>
59-
assert(ctx.isBestEffort || ctx.usesBestEffortTasty || ctx.reporter.errorsReported, s"unexpected tree for type application: $fn")
59+
assert(ctx.reporter.errorsReported || ctx.tolerateErrorsForBestEffort, s"unexpected tree for type application: $fn")
6060
ta.assignType(untpd.TypeApply(fn, args), fn, args)
6161

6262
def Literal(const: Constant)(using Context): Literal =

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,20 @@ object Contexts {
475475
/** Is the flexible types option set? */
476476
def flexibleTypes: Boolean = base.settings.YexplicitNulls.value && !base.settings.YnoFlexibleTypes.value
477477

478-
/** Is best-effort-dir option set? */
478+
/** Is the best-effort option set? */
479479
def isBestEffort: Boolean = base.settings.YbestEffort.value
480480

481-
/** Is the from-best-effort-tasty option set to true? */
481+
/** Is the with-best-effort-tasty option set? */
482482
def withBestEffortTasty: Boolean = base.settings.YwithBestEffortTasty.value
483483

484484
/** Were any best effort tasty dependencies used during compilation? */
485-
def usesBestEffortTasty: Boolean = base.usedBestEffortTasty
485+
def usedBestEffortTasty: Boolean = base.usedBestEffortTasty
486486

487487
/** Confirm that a best effort tasty dependency was used during compilation. */
488-
def setUsesBestEffortTasty(): Unit = base.usedBestEffortTasty = true
488+
def setUsedBestEffortTasty(): Unit = base.usedBestEffortTasty = true
489+
490+
/** Is either the best-effort option set or .betasty files were used during compilation? */
491+
def tolerateErrorsForBestEffort = isBestEffort || usedBestEffortTasty
489492

490493
/** A fresh clone of this context embedded in this context. */
491494
def fresh: FreshContext = freshOver(this)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object DenotTransformers {
2929
/** The transformation method */
3030
def transform(ref: SingleDenotation)(using Context): SingleDenotation
3131

32-
override def isRunnable(using Context) = super.isRunnable && !ctx.usesBestEffortTasty
32+
override def isRunnable(using Context) = super.isRunnable && !ctx.usedBestEffortTasty
3333
}
3434

3535
/** A transformer that only transforms the info field of denotations */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ object Denotations {
720720
|| ctx.settings.YtestPickler.value // mixing test pickler with debug printing can travel back in time
721721
|| ctx.mode.is(Mode.Printing) // no use to be picky when printing error messages
722722
|| symbol.isOneOf(ValidForeverFlags)
723-
|| ctx.isBestEffort || ctx.usesBestEffortTasty,
723+
|| ctx.tolerateErrorsForBestEffort,
724724
s"denotation $this invalid in run ${ctx.runId}. ValidFor: $validFor")
725725
var d: SingleDenotation = this
726726
while ({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ object SymDenotations {
720720
* TODO: Find a more robust way to characterize self symbols, maybe by
721721
* spending a Flag on them?
722722
*/
723-
final def isSelfSym(using Context): Boolean =
723+
final def isSelfSym(using Context): Boolean =
724724
if !ctx.isBestEffort || exists then
725725
owner.infoOrCompleter match {
726726
case ClassInfo(_, _, _, _, selfInfo) =>
@@ -2007,7 +2007,7 @@ object SymDenotations {
20072007
case p :: parents1 =>
20082008
p.classSymbol match {
20092009
case pcls: ClassSymbol => builder.addAll(pcls.baseClasses)
2010-
case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode.Interactive) || ctx.isBestEffort || ctx.usesBestEffortTasty, s"$this has non-class parent: $p")
2010+
case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode.Interactive) || ctx.tolerateErrorsForBestEffort, s"$this has non-class parent: $p")
20112011
}
20122012
traverse(parents1)
20132013
case nil =>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,17 @@ class TastyLoader(val tastyFile: AbstractFile) extends SymbolLoader {
439439
val tastyBytes = tastyFile.toByteArray
440440
val unpickler = new tasty.DottyUnpickler(tastyFile, tastyBytes, isBestEffortTasty = isBestEffortTasty)
441441
unpickler.enter(roots = Set(classRoot, moduleRoot, moduleRoot.sourceModule))(using ctx.withSource(util.NoSource))
442-
if mayLoadTreesFromTasty || (isBestEffortTasty && ctx.withBestEffortTasty) then
442+
if mayLoadTreesFromTasty || isBestEffortTasty then
443443
classRoot.classSymbol.rootTreeOrProvider = unpickler
444444
moduleRoot.classSymbol.rootTreeOrProvider = unpickler
445445
if isBestEffortTasty then
446446
checkBeTastyUUID(tastyFile, tastyBytes)
447-
ctx.setUsesBestEffortTasty()
447+
ctx.setUsedBestEffortTasty()
448448
else
449449
checkTastyUUID()
450450
else
451451
report.error(em"Best Effort TASTy $tastyFile file could not be read.")
452+
452453
private def handleUnpicklingExceptions[T](thunk: =>T): T =
453454
try thunk
454455
catch case e: RuntimeException =>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,9 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
747747
assert(!etp.isInstanceOf[WildcardType] || inSigName, i"Unexpected WildcardType erasure for $tp")
748748
etp
749749

750-
/** Like translucentSuperType, but issue a fatal error if it does not exist. */
750+
/** Like translucentSuperType, but issue a fatal error if it does not exist.
751+
* If using the best-effort option, the fatal error will not be issued.
752+
*/
751753
private def checkedSuperType(tp: TypeProxy)(using Context): Type =
752754
val tp1 = tp.translucentSuperType
753755
if !tp1.exists then

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,7 @@ object Types extends TypeUtils {
31503150
else cls.info match {
31513151
case cinfo: ClassInfo => cinfo.selfType
31523152
case _: ErrorType | NoType
3153-
if ctx.mode.is(Mode.Interactive) || ctx.isBestEffort || ctx.usesBestEffortTasty => cls.info
3153+
if ctx.mode.is(Mode.Interactive) || ctx.tolerateErrorsForBestEffort => cls.info
31543154
// can happen in IDE if `cls` is stale
31553155
}
31563156

@@ -3720,8 +3720,9 @@ object Types extends TypeUtils {
37203720

37213721
def apply(tp1: Type, tp2: Type, soft: Boolean)(using Context): OrType = {
37223722
def where = i"in union $tp1 | $tp2"
3723-
if (!ctx.usesBestEffortTasty) expectValueTypeOrWildcard(tp1, where)
3724-
if (!ctx.usesBestEffortTasty) expectValueTypeOrWildcard(tp2, where)
3723+
if !ctx.usedBestEffortTasty then
3724+
expectValueTypeOrWildcard(tp1, where)
3725+
expectValueTypeOrWildcard(tp2, where)
37253726
assertUnerased()
37263727
unique(new CachedOrType(tp1, tp2, soft))
37273728
}

compiler/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object DottyUnpickler {
2727
compilationUnitInfo: CompilationUnitInfo,
2828
posUnpickler: Option[PositionUnpickler],
2929
commentUnpickler: Option[CommentUnpickler],
30-
isBestEffortTasty: Boolean = false
30+
isBestEffortTasty: Boolean
3131
) extends SectionUnpickler[TreeUnpickler](ASTsSection) {
3232
def unpickle(reader: TastyReader, nameAtRef: NameTable): TreeUnpickler =
3333
new TreeUnpickler(reader, nameAtRef, compilationUnitInfo, posUnpickler, commentUnpickler, isBestEffortTasty)
@@ -52,14 +52,14 @@ object DottyUnpickler {
5252
/** A class for unpickling Tasty trees and symbols.
5353
* @param tastyFile tasty file from which we unpickle (used for CompilationUnitInfo)
5454
* @param bytes the bytearray containing the Tasty file from which we unpickle
55+
* @param isBestEffortTasty specifies whether file should be unpickled as a Best Effort TASTy
5556
* @param mode the tasty file contains package (TopLevel), an expression (Term) or a type (TypeTree)
56-
* @param isBestEffortTasty specifies wheather file should be unpickled as a Best Effort TASTy
5757
*/
5858
class DottyUnpickler(
5959
tastyFile: AbstractFile,
6060
bytes: Array[Byte],
61-
mode: UnpickleMode = UnpickleMode.TopLevel,
62-
isBestEffortTasty: Boolean = false
61+
isBestEffortTasty: Boolean,
62+
mode: UnpickleMode = UnpickleMode.TopLevel
6363
) extends ClassfileParser.Embedded with tpd.TreeProvider {
6464
import tpd.*
6565
import DottyUnpickler.*

compiler/src/dotty/tools/dotc/core/tasty/TastyHTMLPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc
22
package core
33
package tasty
44

5-
class TastyHTMLPrinter(bytes: Array[Byte]) extends TastyPrinter(bytes) {
5+
class TastyHTMLPrinter(bytes: Array[Byte]) extends TastyPrinter(bytes, isBestEffortTasty = false) {
66
override protected def nameStr(str: String): String = s"<span class='name'>$str</span>"
77
override protected def treeStr(str: String): String = s"<span class='tree'>$str</span>"
88
override protected def lengthStr(str: String): String = s"<span class='length'>$str</span>"

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Decorators.*
1717
object TastyPickler:
1818
private val versionString = s"Scala ${config.Properties.simpleVersionString}"
1919

20-
class TastyPickler(val rootCls: ClassSymbol) {
20+
class TastyPickler(val rootCls: ClassSymbol, isBestEffortTasty: Boolean) {
2121

2222
private val sections = new mutable.ArrayBuffer[(NameRef, TastyBuffer)]
2323

@@ -26,7 +26,7 @@ class TastyPickler(val rootCls: ClassSymbol) {
2626
def newSection(name: String, buf: TastyBuffer): Unit =
2727
sections += ((nameBuffer.nameIndex(name.toTermName), buf))
2828

29-
def assembleParts(isBestEffortTasty: Boolean = false): Array[Byte] = {
29+
def assembleParts(): Array[Byte] = {
3030
def lengthWithLength(buf: TastyBuffer) =
3131
buf.length + natSize(buf.length)
3232

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object TastyPrinter:
3939
val noColor = args.contains("-color:never")
4040
val allowBetasty = args.contains(betastyOpt)
4141
var printLastLine = false
42-
def printTasty(fileName: String, bytes: Array[Byte], isBestEffortTasty: Boolean = false): Unit =
42+
def printTasty(fileName: String, bytes: Array[Byte], isBestEffortTasty: Boolean): Unit =
4343
println(line)
4444
println(fileName)
4545
println(line)

compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ object TastyUnpickler {
6565

6666
import TastyUnpickler.*
6767

68-
class TastyUnpickler(protected val reader: TastyReader, isBestEffortTasty: Boolean = false) {
68+
class TastyUnpickler(protected val reader: TastyReader, isBestEffortTasty: Boolean) {
6969
import reader.*
7070

7171
def this(bytes: Array[Byte]) = this(new TastyReader(bytes), false)

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package tasty
66
import scala.language.unsafeNulls
77

88
import dotty.tools.tasty.TastyFormat.*
9+
import dotty.tools.tasty.besteffort.BestEffortTastyFormat.ERRORtype
910
import dotty.tools.tasty.TastyBuffer.*
1011

1112
import ast.Trees.*
@@ -65,12 +66,15 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
6566
fillRef(lengthAddr, currentAddr, relative = true)
6667
}
6768

68-
/* There are certain expectations with code naturally being able to reach pickling
69-
* phase as opposed to one that uses best-effort compilation features. For betasty
70-
* files, we try to avoid calling any assertions which can be unfullfilled.
69+
/** There are certain expectations with code which is naturally able to reach pickling
70+
* phase as opposed to one that uses best-effort compilation features.
71+
* When pickling betasty files, we do some custom checks, in case those expectations
72+
* cannot be fulfilled, and if then we can try to do something else.
73+
* For regular non best-effort compilation (without best-effort and without using .betasty on classpath),
74+
* this will always return true.
7175
*/
72-
private inline def assertForBestEffort(assertion: Boolean)(using Context): Boolean =
73-
((!ctx.isBestEffort && ctx.reporter.errorsReported) || ctx.usesBestEffortTasty) || assertion
76+
private inline def passesConditionForErroringBestEffortCode(condition: Boolean)(using Context): Boolean =
77+
((!ctx.isBestEffort && ctx.reporter.errorsReported) || ctx.usedBestEffortTasty) || condition
7478

7579
def addrOfSym(sym: Symbol): Option[Addr] =
7680
symRefs.get(sym)
@@ -307,8 +311,6 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
307311
else if !pickled then pickleErrorType()
308312
case tpe: LazyRef =>
309313
pickleType(tpe.ref)
310-
case tpe: ErrorType if ctx.isBestEffort =>
311-
pickleErrorType()
312314
case _ if ctx.isBestEffort =>
313315
pickleErrorType()
314316
}
@@ -339,7 +341,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
339341
}
340342

341343
def pickleTpt(tpt: Tree)(using Context): Unit =
342-
if assertForBestEffort(tpt.isType) then pickleTree(tpt)
344+
if passesConditionForErroringBestEffortCode(tpt.isType) then pickleTree(tpt)
343345
else pickleErrorType()
344346

345347
def pickleTreeUnlessEmpty(tree: Tree)(using Context): Unit = {
@@ -354,7 +356,11 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
354356
def pickleDef(tag: Int, mdef: MemberDef, tpt: Tree, rhs: Tree = EmptyTree, pickleParams: => Unit = ())(using Context): Unit = {
355357
val sym = mdef.symbol
356358

357-
if assertForBestEffort(symRefs.get(sym) == Some(NoAddr) && !(tag == TYPEDEF && tpt.isInstanceOf[Template] && !tpt.symbol.exists)) then
359+
def isDefSymPreRegisteredAndTreeHasCorrectStructure() =
360+
symRefs.get(sym) == Some(NoAddr) && // check if symbol id preregistered (with the preRegister method)
361+
!(tag == TYPEDEF && tpt.isInstanceOf[Template] && !tpt.symbol.exists) // in case this is a TEMPLATE, check if we are able to pickle it
362+
363+
if passesConditionForErroringBestEffortCode(isDefSymPreRegisteredAndTreeHasCorrectStructure()) then
358364
assert(symRefs(sym) == NoAddr, sym)
359365
registerDef(sym)
360366
writeByte(tag)
@@ -418,7 +424,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
418424
else
419425
try tree match {
420426
case Ident(name) =>
421-
if assertForBestEffort(tree.hasType) then
427+
if passesConditionForErroringBestEffortCode(tree.hasType) then
422428
tree.tpe match {
423429
case tp: TermRef if name != nme.WILDCARD =>
424430
// wildcards are pattern bound, need to be preserved as ids.
@@ -458,7 +464,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
458464
pickleType(tp)
459465
}
460466
case _ =>
461-
if assertForBestEffort(tree.hasType) then
467+
if passesConditionForErroringBestEffortCode(tree.hasType) then
462468
val sig = tree.tpe.signature
463469
var ename = tree.symbol.targetName
464470
val selectFromQualifier =
@@ -478,7 +484,11 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
478484
pickleTree(qual)
479485
pickleType(tree.symbol.owner.typeRef)
480486
}
481-
else pickleErrorType()
487+
else
488+
writeByte(if name.isTypeName then SELECTtpt else SELECT)
489+
val ename = tree.symbol.targetName
490+
pickleNameAndSig(name, Signature.NotAMethod, ename)
491+
pickleTree(qual)
482492
}
483493
case Apply(fun, args) =>
484494
if (fun.symbol eq defn.throwMethod) {
@@ -506,13 +516,14 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
506516
args.foreach(pickleTpt)
507517
}
508518
case Literal(const1) =>
509-
if assertForBestEffort(tree.hasType) then
519+
if passesConditionForErroringBestEffortCode(tree.hasType) then
510520
pickleConstant {
511521
tree.tpe match {
512522
case ConstantType(const2) => const2
513523
case _ => const1
514524
}
515525
}
526+
else pickleConstant(const1)
516527
case Super(qual, mix) =>
517528
writeByte(SUPER)
518529
withLength {
@@ -684,15 +695,15 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
684695
writeByte(PACKAGE)
685696
withLength { pickleType(pid.tpe); pickleStats(stats) }
686697
case tree: TypeTree =>
687-
if assertForBestEffort(tree.hasType) then pickleType(tree.tpe)
698+
if passesConditionForErroringBestEffortCode(tree.hasType) then pickleType(tree.tpe)
688699
else pickleErrorType()
689700
case SingletonTypeTree(ref) =>
690701
writeByte(SINGLETONtpt)
691702
pickleTree(ref)
692703
case RefinedTypeTree(parent, refinements) =>
693704
if (refinements.isEmpty) pickleTree(parent)
694705
else {
695-
if assertForBestEffort(refinements.head.symbol.exists) then
706+
if passesConditionForErroringBestEffortCode(refinements.head.symbol.exists) then
696707
val refineCls = refinements.head.symbol.owner.asClass
697708
registerDef(refineCls)
698709
pickledTypes(refineCls.typeRef) = currentAddr

0 commit comments

Comments
 (0)