Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ include: package:dart_flutter_team_lints/analysis_options.yaml
analyzer:
language:
strict-casts: true
errors:
# Analyzer v7.4.0 crazy
deprecated_member_use: ignore

linter:
rules:
Expand Down
7 changes: 6 additions & 1 deletion json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## 6.9.5

- Support the `analyzer: '>=6.9.0 <8.0.0'`.
- Fixed use of deprecated analyzer APIs.

## 6.9.4

- Fix extra line being generated when targetting Dart 3.7 package.
- Fix extra line being generated when targeting Dart 3.7 package.

## 6.9.3

Expand Down
5 changes: 1 addition & 4 deletions json_serializable/lib/src/decode_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ mixin DecodeHelper implements HelperCore {
config.constructor,
accessibleFields.keys,
accessibleFields.values
.where((fe) =>
element.augmented
.lookUpSetter(name: fe.name, library: element.library) !=
null)
.where((fe) => element.lookUpSetter(fe.name, element.library) != null)
.map((fe) => fe.name)
.toList(),
unavailableReasons,
Expand Down
14 changes: 10 additions & 4 deletions json_serializable/lib/src/field_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/element/element.dart' // ignore: implementation_imports
show
InterfaceElementImpl;
import 'package:analyzer/src/dart/element/inheritance_manager3.dart' // ignore: implementation_imports
show
InheritanceManager3;
Expand Down Expand Up @@ -81,15 +84,18 @@ List<FieldElement> createSortedFieldSet(ClassElement element) {
final inheritedFields = <String, FieldElement>{};
final manager = InheritanceManager3();

for (final v in manager.getInheritedConcreteMap2(element).values) {
for (final v in manager
.getInheritedConcreteMap2(element as InterfaceElementImpl)
.values) {
assert(v is! FieldElement);
if (_dartCoreObjectChecker.isExactly(v.enclosingElement3)) {
continue;
}

if (v is PropertyAccessorElement && v.isGetter) {
assert(v.variable2 is FieldElement);
final variable = v.variable2 as FieldElement;
if (v is PropertyAccessorElement &&
(v as PropertyAccessorElement).isGetter) {
assert((v as PropertyAccessorElement).variable2 is FieldElement);
final variable = (v as PropertyAccessorElement).variable2 as FieldElement;
assert(!inheritedFields.containsKey(variable.name));
inheritedFields[variable.name] = variable;
}
Expand Down
4 changes: 2 additions & 2 deletions json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_serializable
version: 6.9.4
version: 6.9.5
description: >-
Automatically generate code for converting to and from JSON by annotating
Dart classes.
Expand All @@ -15,7 +15,7 @@ topics:
resolution: workspace

dependencies:
analyzer: '>=6.5.0 <8.0.0'
analyzer: '>=6.9.0 <8.0.0'
async: ^2.10.0
build: ^2.4.1
build_config: ^1.1.0
Expand Down