diff --git a/build/CHANGELOG.md b/build/CHANGELOG.md index 8d94de2a5..0d1389077 100644 --- a/build/CHANGELOG.md +++ b/build/CHANGELOG.md @@ -1,7 +1,8 @@ ## 2.4.2-wip - Bump the min sdk to 3.4.0. -- Remove some unnecessary casts now that we have private field promotion. +- Remove some unnecessary casts and non-null assertions now that we have private + field promotion. ## 2.4.1 diff --git a/build_runner_core/CHANGELOG.md b/build_runner_core/CHANGELOG.md index fc7768a66..adaf28682 100644 --- a/build_runner_core/CHANGELOG.md +++ b/build_runner_core/CHANGELOG.md @@ -1,6 +1,8 @@ ## 7.3.1-wip - Bump the min sdk to 3.4.0. +- Remove some unnecessary casts and non-null assertions now that we have private + field promotion. ## 7.3.0 diff --git a/build_runner_core/lib/src/asset/reader.dart b/build_runner_core/lib/src/asset/reader.dart index bbf29dbde..33cc66763 100644 --- a/build_runner_core/lib/src/asset/reader.dart +++ b/build_runner_core/lib/src/asset/reader.dart @@ -173,7 +173,7 @@ class SingleStepReader implements AssetReader { } var streamCompleter = StreamCompleter(); - doAfter(_getGlobNode!(glob, _primaryPackage, _phaseNumber), + doAfter(_getGlobNode(glob, _primaryPackage, _phaseNumber), (GlobAssetNode globNode) { assetsRead.add(globNode.id); streamCompleter.setSourceStream(Stream.fromIterable(globNode.results!)); diff --git a/build_runner_core/lib/src/generate/build_impl.dart b/build_runner_core/lib/src/generate/build_impl.dart index ec088770d..f5a27cf96 100644 --- a/build_runner_core/lib/src/generate/build_impl.dart +++ b/build_runner_core/lib/src/generate/build_impl.dart @@ -266,7 +266,7 @@ class _SingleBuild { var invalidated = await _assetGraph.updateAndInvalidate( _buildPhases, updates, _packageGraph.root.name, _delete, _reader); if (_reader is CachingAssetReader) { - (_reader as CachingAssetReader).invalidate(invalidated); + _reader.invalidate(invalidated); } }); } @@ -306,7 +306,7 @@ class _SingleBuild { assert(result.performance != null); var now = DateTime.now(); var logPath = p.join( - _logPerformanceDir!, + _logPerformanceDir, '${now.year}-${_twoDigits(now.month)}-${_twoDigits(now.day)}' '_${_twoDigits(now.hour)}-${_twoDigits(now.minute)}-' '${_twoDigits(now.second)}');