From a7fdf7101fbd31132a59188a6057d21004345927 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Thu, 27 Jun 2024 09:34:55 -0700 Subject: [PATCH] Use curly braces in if statement, in accordance with upcoming lint rule change. This lint rule currently measures from the end of the condition, but needs to measure from the start of the if-statement. E.g. if ("long condition and other long condition" != "another long condition" && "more tests".isNotEmpty) return null; This is currently allowed, but should not be, as per Effective Dart. This will be fixed in a Dart SDK CL. PiperOrigin-RevId: 647347218 --- lib/src/builder.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/builder.dart b/lib/src/builder.dart index 9f0a5873..5abd5d96 100644 --- a/lib/src/builder.dart +++ b/lib/src/builder.dart @@ -602,7 +602,9 @@ class _MockTargetGatherer { // turned into `dynamic` by the analyzer. typeArguments.forEachIndexed((typeArgIdx, typeArgument) { if (!(typeArgument is analyzer.DynamicType || - typeArgument is analyzer.InvalidType)) return; + typeArgument is analyzer.InvalidType)) { + return; + } if (typeArgIdx >= mockTypeArguments.arguments.length) return; final typeArgAst = mockTypeArguments.arguments[typeArgIdx]; if (typeArgAst is! ast.NamedType) {