Skip to content

Commit 41ced9a

Browse files
authored
Fix incorrect passing of compile times (#1626)
1 parent 2391ab7 commit 41ced9a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

internal/execute/build/buildtask.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (t *buildTask) buildProject(orchestrator *Orchestrator, path tspath.Path) {
122122
t.reportDiagnostic,
123123
tsc.QuietDiagnosticsReporter,
124124
&t.builder,
125-
compileTimes,
125+
&compileTimes,
126126
orchestrator.opts.Testing,
127127
)
128128
t.exitStatus = result.Status

internal/execute/tsc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, te
222222
reportDiagnostic,
223223
reportErrorSummary,
224224
extendedConfigCache,
225-
compileTimes,
225+
&compileTimes,
226226
testing,
227227
)
228228
}
@@ -232,7 +232,7 @@ func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, te
232232
reportDiagnostic,
233233
reportErrorSummary,
234234
extendedConfigCache,
235-
compileTimes,
235+
&compileTimes,
236236
testing,
237237
)
238238
}
@@ -261,7 +261,7 @@ func performIncrementalCompilation(
261261
reportDiagnostic tsc.DiagnosticReporter,
262262
reportErrorSummary tsc.DiagnosticsReporter,
263263
extendedConfigCache tsoptions.ExtendedConfigCache,
264-
compileTimes tsc.CompileTimes,
264+
compileTimes *tsc.CompileTimes,
265265
testing tsc.CommandLineTesting,
266266
) tsc.CommandLineResult {
267267
host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing))
@@ -304,7 +304,7 @@ func performCompilation(
304304
reportDiagnostic tsc.DiagnosticReporter,
305305
reportErrorSummary tsc.DiagnosticsReporter,
306306
extendedConfigCache tsoptions.ExtendedConfigCache,
307-
compileTimes tsc.CompileTimes,
307+
compileTimes *tsc.CompileTimes,
308308
testing tsc.CommandLineTesting,
309309
) tsc.CommandLineResult {
310310
host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing))

internal/execute/tsc/compile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ type CompileAndEmitResult struct {
7171
Diagnostics []*ast.Diagnostic
7272
EmitResult *compiler.EmitResult
7373
Status ExitStatus
74-
times CompileTimes
74+
times *CompileTimes
7575
}

internal/execute/tsc/emit.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func EmitAndReportStatistics(
3030
reportDiagnostic DiagnosticReporter,
3131
reportErrorSummary DiagnosticsReporter,
3232
w io.Writer,
33-
compileTimes CompileTimes,
33+
compileTimes *CompileTimes,
3434
testing CommandLineTesting,
3535
) (CompileAndEmitResult, *Statistics) {
3636
var statistics *Statistics
@@ -48,7 +48,7 @@ func EmitAndReportStatistics(
4848
runtime.GC()
4949
runtime.ReadMemStats(&memStats)
5050

51-
statistics = statisticsFromProgram(program, &compileTimes, &memStats)
51+
statistics = statisticsFromProgram(program, compileTimes, &memStats)
5252
statistics.Report(w, testing)
5353
}
5454

@@ -67,7 +67,7 @@ func EmitFilesAndReportErrors(
6767
reportDiagnostic DiagnosticReporter,
6868
reportErrorSummary DiagnosticsReporter,
6969
w io.Writer,
70-
compileTimes CompileTimes,
70+
compileTimes *CompileTimes,
7171
testing CommandLineTesting,
7272
) (result CompileAndEmitResult) {
7373
result.times = compileTimes

internal/execute/watcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (w *Watcher) DoCycle() {
9494
func (w *Watcher) compileAndEmit() {
9595
// !!! output/error reporting is currently the same as non-watch mode
9696
// diagnostics, emitResult, exitStatus :=
97-
tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), tsc.CompileTimes{}, w.testing)
97+
tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), &tsc.CompileTimes{}, w.testing)
9898
}
9999

100100
func (w *Watcher) hasErrorsInTsConfig() bool {

0 commit comments

Comments
 (0)