Skip to content

Commit 31c05ec

Browse files
committed
Initialize context with NoOpProfiler to prevent null pointer exceptions and to match the store non-nullable signature
1 parent 7dd8f82 commit 31c05ec

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
@@ -766,6 +766,7 @@ object Contexts {
766766
.updated(settingsStateLoc, settingsGroup.defaultState)
767767
.updated(notNullInfosLoc, Nil)
768768
.updated(compilationUnitLoc, NoCompilationUnit)
769+
.updated(profilerLoc, Profiler.NoOp)
769770
c._searchHistory = new SearchRoot
770771
c._gadtState = GadtState(GadtConstraint.empty)
771772
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)