Skip to content

Commit b61f501

Browse files
committed
fix passesConditionForErroringBestEffortCode and improve doc comments
1 parent aefd681 commit b61f501

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
6969
/** There are certain expectations with code which is naturally able to reach pickling
7070
* phase as opposed to one that uses best-effort compilation features.
7171
* 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.
72+
* cannot be fulfilled, and if so, then we can try to do something else.
73+
* For regular non best-effort compilation (without -Ybest-effort and without using
74+
* .betasty on classpath), this will always return true.
7575
*/
7676
private inline def passesConditionForErroringBestEffortCode(condition: => Boolean)(using Context): Boolean =
77-
((!ctx.isBestEffort && ctx.reporter.errorsReported) || ctx.usedBestEffortTasty) || condition
77+
!((ctx.isBestEffort && ctx.reporter.errorsReported) || ctx.usedBestEffortTasty) || condition
7878

7979
def addrOfSym(sym: Symbol): Option[Addr] =
8080
symRefs.get(sym)

compiler/src/dotty/tools/dotc/transform/Pickler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class Pickler extends Phase {
6262
(super.isRunnable || ctx.isBestEffort)
6363
&& !ctx.settings.fromTasty.value
6464
&& (!ctx.usedBestEffortTasty || ctx.isBestEffort)
65-
// we do not want to pickle `.betasty` if will not create the file either way
65+
// we do not want to pickle `.betasty` if do not plan to actually create the
66+
// betasty file (as signified by the -Ybest-effort option)
6667

6768
// when `-Yjava-tasty` is set we actually want to run this phase on Java sources
6869
override def skipIfJava(using Context): Boolean = false

0 commit comments

Comments
 (0)