Skip to content

Commit ad196cf

Browse files
committed
Initialize context with NoOpProfiler to prevent null pointer exceptions and to match the store non-nullable signature
1 parent 2c8199e commit ad196cf

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
@@ -769,6 +769,7 @@ object Contexts {
769769
.updated(settingsStateLoc, settingsGroup.defaultState)
770770
.updated(notNullInfosLoc, Nil)
771771
.updated(compilationUnitLoc, NoCompilationUnit)
772+
.updated(profilerLoc, Profiler.NoOp)
772773
c._searchHistory = new SearchRoot
773774
c._gadtState = GadtState(GadtConstraint.empty)
774775
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)