Skip to content

Commit

Permalink
Bump deps on analyzer and dart_style
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Sep 10, 2024
1 parent 55d68f4 commit 01473d6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions json_serializable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 6.9.0-wip

- Use conditional map syntax to clean up `null` handling in `toJson` functions.
- Require `analyzer: ^6.9.0`
- Require Dart 3.5

## 6.8.0
Expand Down
12 changes: 6 additions & 6 deletions json_serializable/lib/src/field_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ class _FieldSet implements Comparable<_FieldSet> {

static int _sortByLocation(FieldElement a, FieldElement b) {
final checkerA = TypeChecker.fromStatic(
(a.enclosingElement as InterfaceElement).thisType,
(a.enclosingElement3 as InterfaceElement).thisType,
);

if (!checkerA.isExactly(b.enclosingElement)) {
if (!checkerA.isExactly(b.enclosingElement3)) {
// in this case, you want to prioritize the enclosingElement that is more
// "super".

if (checkerA.isAssignableFrom(b.enclosingElement)) {
if (checkerA.isAssignableFrom(b.enclosingElement3)) {
return -1;
}

final checkerB = TypeChecker.fromStatic(
(b.enclosingElement as InterfaceElement).thisType);
(b.enclosingElement3 as InterfaceElement).thisType);

if (checkerB.isAssignableFrom(a.enclosingElement)) {
if (checkerB.isAssignableFrom(a.enclosingElement3)) {
return 1;
}
}
Expand Down Expand Up @@ -83,7 +83,7 @@ List<FieldElement> createSortedFieldSet(ClassElement element) {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ _JsonConvertData? _typeConverterFrom(

final annotationElement = match.elementAnnotation?.element;
if (annotationElement is PropertyAccessorElement) {
final enclosing = annotationElement.enclosingElement;
final enclosing = annotationElement.enclosingElement3;

var accessString = annotationElement.name;

Expand Down
6 changes: 3 additions & 3 deletions json_serializable/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ extension ExecutableElementExtension on ExecutableElement {
}

if (this is MethodElement) {
return '${enclosingElement.name}.$name';
return '${enclosingElement3.name}.$name';
}

if (this is ConstructorElement) {
// Ignore the default constructor.
if (name.isEmpty) {
return '${enclosingElement.name}';
return '${enclosingElement3.name}';
}
return '${enclosingElement.name}.$name';
return '${enclosingElement3.name}.$name';
}

throw UnsupportedError(
Expand Down
4 changes: 2 additions & 2 deletions json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ topics:
resolution: workspace

dependencies:
analyzer: ^6.5.0
analyzer: ^6.9.0
async: ^2.10.0
build: ^2.4.1
build_config: ^1.1.0
Expand All @@ -36,7 +36,7 @@ dev_dependencies:
path: ../shared_test
build_runner: ^2.4.6
build_verify: ^3.0.0
dart_style: ^2.3.2
dart_style: ^2.3.7
logging: ^1.0.0
source_gen_test: ^1.0.6
test: ^1.24.4
Expand Down
3 changes: 2 additions & 1 deletion json_serializable/tool/shared.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import 'package:build/build.dart';
import 'package:dart_style/dart_style.dart';
import 'package:yaml/yaml.dart';

final formatter = DartFormatter();
final formatter =
DartFormatter(languageVersion: DartFormatter.latestLanguageVersion);

// Until we have verification in pkg:build and friends
// https://github.com/dart-lang/build/issues/590
Expand Down

0 comments on commit 01473d6

Please sign in to comment.