Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require 'analyzer 6.9.0+' and SDK 3.6.0-edge #1324

Merged
merged 1 commit into from
Sep 24, 2024
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
2 changes: 1 addition & 1 deletion built_value_generator/lib/src/dart_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DartTypes {
} else if (dartType is TypeParameterType) {
return dartType.element.name + suffix;
} else if (dartType is RecordType) {
return dartType.getDisplayString(withNullability: false);
return dartType.getDisplayString();
} else if (dartType is VoidType) {
return 'void';
} else if (dartType.isBottom) {
Expand Down
5 changes: 2 additions & 3 deletions built_value_generator/lib/src/enum_source_class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import 'package:built_value_generator/src/dart_types.dart';
import 'package:built_value_generator/src/enum_source_field.dart';
import 'package:built_value_generator/src/parsed_library_results.dart';
import 'package:built_value_generator/src/strings.dart';
import 'package:collection/collection.dart'
show IterableExtension, IterableNullableExtension;
import 'package:collection/collection.dart' show IterableExtension;

import 'library_elements.dart';

Expand Down Expand Up @@ -114,7 +113,7 @@ abstract class EnumSourceClass
valuesIdentifier,
valueOfIdentifier,
for (var field in fields) field.generatedIdentifier,
].whereNotNull().toList();
].nonNulls.toList();
}

static bool needsEnumClass(ClassElement classElement) {
Expand Down
2 changes: 1 addition & 1 deletion built_value_generator/lib/src/fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BuiltList<FieldElement> _fieldElementsForType(InterfaceType type) {
var result = ListBuilder<FieldElement>();
for (var accessor in type.accessors) {
if (accessor.isSetter) continue;
result.add(accessor.variable as FieldElement);
result.add(accessor.variable2 as FieldElement);
}
return result.build();
}
4 changes: 2 additions & 2 deletions built_value_generator/lib/src/serializer_source_library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class SerializerSourceLibrary
.toList();

for (var accessor in accessors) {
final annotations = accessor.variable.metadata
final annotations = accessor.variable2!.metadata
.where((annotation) =>
DartTypes.tryGetName(annotation.computeConstantValue()?.type) ==
'SerializersFor')
Expand All @@ -72,7 +72,7 @@ abstract class SerializerSourceLibrary
.toList();

for (var accessor in accessors) {
final annotations = accessor.variable.metadata
final annotations = accessor.variable2!.metadata
.where((annotation) =>
DartTypes.tryGetName(annotation.computeConstantValue()?.type) ==
'SerializersFor')
Expand Down
2 changes: 1 addition & 1 deletion built_value_generator/lib/src/value_source_class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ abstract class ValueSourceClass
// Check for any `toString` implementation apart from the one defined on
// `Object`.
var method = element.lookUpConcreteMethod('toString', element.library)!;
var clazz = method.enclosingElement;
var clazz = method.enclosingElement3;
return clazz is! ClassElement || clazz.name != 'Object';
}

Expand Down
4 changes: 2 additions & 2 deletions built_value_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ topics:
- build-runner

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.6.0-edge <4.0.0'

dependencies:
analyzer: '>=5.2.0 <7.0.0'
analyzer: '>=6.9.0 <7.0.0'
build: '>=1.0.0 <3.0.0'
build_config: '>=0.3.1 <2.0.0'
built_collection: ^5.0.0
Expand Down
Loading