Skip to content

Commit 4993d08

Browse files
committed
Initialize context with NoOpProfiler to prevent null pointer exceptions and to match the store non-nullable signature
1 parent cc91d43 commit 4993d08

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ object Contexts {
750750
.updated(settingsStateLoc, settingsGroup.defaultState)
751751
.updated(notNullInfosLoc, Nil)
752752
.updated(compilationUnitLoc, NoCompilationUnit)
753+
.updated(profilerLoc, Profiler.NoOp)
753754
c._searchHistory = new SearchRoot
754755
c._gadtState = GadtState(GadtConstraint.empty)
755756
c

compiler/src/dotty/tools/dotc/profile/Profiler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ object Profiler {
3232
new RealProfiler(reporter)
3333
}
3434

35+
final def NoOp: Profiler = NoOpProfiler
36+
3537
private[profile] val emptySnap: ProfileSnap = ProfileSnap(0, "", 0, 0, 0, 0, 0, 0, 0, 0)
3638
}
3739

0 commit comments

Comments
 (0)