Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 075a3b6

Browse files
pqdomesticmouse
andauthored
1.27.0 (#3576)
* 1.27.0 * Insert reasoning for `avoid_function_literals_in_foreach_calls` lint (#3545) * Update avoid_function_literals_in_foreach_calls.dart * Second attempt * Add a the to make for betterer english * convert unnecessary `.from`s to `.of`s (#3577) * deflake `avoid_redundant_argument_values` * ++ Co-authored-by: Brett Morgan <[email protected]>
1 parent b677397 commit 075a3b6

5 files changed

+43
-3
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# 1.27.0
2+
3+
- fix `avoid_redundant_argument_values` when referencing required
4+
parameters in legacy libraries
5+
- performance improvements for `use_late_for_private_fields_and_variables`
6+
- new lint: `use_string_in_part_of_directives`
7+
- fixed `use_super_parameters` false positive with repeated super
8+
parameter references
9+
- updated `use_late_for_private_fields_and_variables` to handle enums
10+
- fixed `prefer_contains` false positive when start index is non-zero
11+
- improved `noop_primitive_operations` to catch `.toString()`
12+
in string interpolations
13+
- updated `public_member_api_docs` to report diagnostics on extension
14+
names (instead of bodies)
15+
- miscellaneous documentation improvements
16+
- (internal): `DartTypeUtilities` refactoring
17+
118
# 1.26.0
219

320
- new lint: `combinators_ordering`

lib/src/rules/avoid_redundant_argument_values.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ class _Visitor extends SimpleAstVisitor {
7171
for (var i = arguments.length - 1; i >= 0; --i) {
7272
var arg = arguments[i];
7373
var param = arg.staticParameterElement;
74-
if (param == null || param.hasRequired || !param.isOptional) {
74+
if (param == null ||
75+
param.declaration.isRequired ||
76+
param.hasRequired ||
77+
!param.isOptional) {
7578
continue;
7679
}
7780
var value = param.computeConstantValue();

lib/src/version.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
/// Package version. Synchronized w/ pubspec.yaml.
6-
const String version = '1.26.0';
6+
const String version = '1.27.0';

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: linter
2-
version: 1.26.0
2+
version: 1.27.0
33

44
description: >-
55
The implementation of the lint rules supported by the analyzer framework.

test/rules/avoid_redundant_argument_values_test.dart

+20
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,26 @@ void g() {
5151
''');
5252
}
5353

54+
/// https://github.com/dart-lang/sdk/issues/49596
55+
test_legacyRequired() async {
56+
var a = newFile('$testPackageLibPath/a.dart', r'''
57+
class Foo {
58+
int? foo;
59+
Foo({required this.foo});
60+
}
61+
''');
62+
await resolveFile(a.path);
63+
64+
await assertNoDiagnostics(r'''
65+
// @dart = 2.9
66+
import 'a.dart';
67+
68+
void f() {
69+
Foo(foo: null);
70+
}
71+
''');
72+
}
73+
5474
test_requiredNullable() async {
5575
await assertNoDiagnostics(r'''
5676
void f({required int? x}) { }

0 commit comments

Comments
 (0)