Skip to content

Commit f4d69ea

Browse files
committed
Fix errors under explicit nulls
1 parent 317b0e7 commit f4d69ea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/reporting/Profile.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ abstract class Profile:
1616

1717
object Profile:
1818
def current(using Context): Profile =
19-
if ctx.run == null then NoProfile else ctx.run.profile
19+
val run = ctx.run
20+
if run == null then NoProfile else run.profile
2021

21-
private val TastyFactor = 40
22+
private val TastyFactor = 50
2223

2324
class Info:
2425
var lineCount: Int = 0
@@ -34,7 +35,7 @@ class ActiveProfile extends Profile:
3435
private val junkInfo = new Profile.Info
3536

3637
private def curInfo(using Context): Profile.Info =
37-
val unit = ctx.compilationUnit
38+
val unit: CompilationUnit | Null = ctx.compilationUnit
3839
if unit == null then junkInfo else unitProfile(unit)
3940

4041
def unitProfile(unit: CompilationUnit): Profile.Info =

0 commit comments

Comments
 (0)