Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Fixes for expansion of 'prefer_final_in_for_each' (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough authored Jun 27, 2023
1 parent 92f2f89 commit 819b959
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/common_server_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class CommonServerImpl {
Future<proto.VersionResponse> version(proto.VersionRequest _) {
final packageVersions = getPackageVersions();
final packageInfos = [
for (var packageName in packageVersions.keys)
for (final packageName in packageVersions.keys)
proto.PackageInfo()
..name = packageName
..version = packageVersions[packageName]!
Expand Down
4 changes: 2 additions & 2 deletions lib/src/compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Compiler {
sourcesFileList: files.keys.toList(), devMode: _sdk.devMode);
if (unsupportedImports.isNotEmpty) {
return CompilationResults(problems: [
for (var import in unsupportedImports)
for (final import in unsupportedImports)
CompilationProblem._('unsupported import: ${import.uri.stringValue}'),
]);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ class Compiler {
sourcesFileList: files.keys.toList(), devMode: _sdk.devMode);
if (unsupportedImports.isNotEmpty) {
return DDCCompilationResults.failed([
for (var import in unsupportedImports)
for (final import in unsupportedImports)
CompilationProblem._('unsupported import: ${import.uri.stringValue}'),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/project_creator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ ${_sdk.experiments.map((experiment) => ' - $experiment').join('\n')}
final allVersions =
parsePubDependenciesFile(dependenciesFile: _dependenciesFile);
final result = {
for (var package in packages) package: allVersions[package] ?? 'any',
for (final package in packages) package: allVersions[package] ?? 'any',
};

// Overwrite with important constraints.
Expand Down
6 changes: 3 additions & 3 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ Future<void> _updateDependenciesFile({
final dependencies = <String, String>{
'lints': 'any',
'flutter_lints': 'any',
for (var package in firebasePackages) package: 'any',
for (var package in supportedFlutterPackages(devMode: sdk.devMode))
for (final package in firebasePackages) package: 'any',
for (final package in supportedFlutterPackages(devMode: sdk.devMode))
package: 'any',
for (var package in supportedBasicDartPackages(devMode: sdk.devMode))
for (final package in supportedBasicDartPackages(devMode: sdk.devMode))
package: 'any',
};

Expand Down

0 comments on commit 819b959

Please sign in to comment.