diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 3a44080bb16..c4ba45cbd10 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -465,6 +465,7 @@ class DevFS { generator.reset(); } printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files'); + lastCompiled = DateTime.now(); final CompilerOutput compilerOutput = await generator.recompile( mainPath, invalidatedFiles, @@ -474,8 +475,6 @@ class DevFS { if (compilerOutput == null || compilerOutput.errorCount > 0) { return UpdateFSReport(success: false); } - // Only update the last compiled time if we successfully compiled. - lastCompiled = DateTime.now(); // list of sources that needs to be monitored are in [compilerOutput.sources] sources = compilerOutput.sources; // diff --git a/packages/flutter_tools/test/general.shard/devfs_test.dart b/packages/flutter_tools/test/general.shard/devfs_test.dart index 68c935c129f..90d919a2b22 100644 --- a/packages/flutter_tools/test/general.shard/devfs_test.dart +++ b/packages/flutter_tools/test/general.shard/devfs_test.dart @@ -178,7 +178,6 @@ void main() { testUsingContext('reports unsuccessful compile when errors are returned', () async { devFS = DevFS(vmService, 'test', tempDir); await devFS.create(); - final DateTime previousCompile = devFS.lastCompiled; final RealMockResidentCompiler residentCompiler = RealMockResidentCompiler(); when(residentCompiler.recompile( @@ -198,7 +197,6 @@ void main() { ); expect(report.success, false); - expect(devFS.lastCompiled, previousCompile); }, overrides: { FileSystem: () => fs, });