Skip to content

Commit

Permalink
Upgrade analyzer to 5.2.0 (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Oct 26, 2022
1 parent e52df53 commit 80a4ef0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion packages/freezed/CHANGELOG.md
@@ -1,8 +1,12 @@
# 2.2.1

Upgrade analyzer

# 2.2.0

- The generated `copyWith` is now annotated by `@useResult` (thanks to @miDeb)
- Improved performance of `copyWith` (thanks to @miDeb)
- Improved type inference when using `mapOrNull`/`whenOrNull` (thanks to @DevNico)
- Improved type inference when using `mapOrNull`/`whenOrNull` (thanks to @DevNico)
- Re-introduced `@With.fromString` and `@Implements.fromString` to allow unions
to implement generic types. (thanks to @rorystephenson)
- fixes @Default for Strings containing (, [ or { (thanks to @hugobrancowb)
Expand Down
6 changes: 3 additions & 3 deletions packages/freezed/lib/src/freezed_generator.dart
Expand Up @@ -424,7 +424,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C

final parameterType = parameter.type;
if (parameterType is! InterfaceType) continue;
final element = parameterType.element2;
final element = parameterType.element;
if (element is! ClassElement) continue;

final classElement = element;
Expand Down Expand Up @@ -660,7 +660,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C
element,
...element.allSupertypes
.where((e) => !e.isDartCoreObject)
.map((e) => e.element2)
.map((e) => e.element)
]) {
for (final method in type.methods) {
if (method.name == 'toString') {
Expand All @@ -677,7 +677,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C
element,
...element.allSupertypes
.where((e) => !e.isDartCoreObject)
.map((e) => e.element2)
.map((e) => e.element)
]) {
for (final method in type.methods.where((e) => e.isOperator)) {
if (method.name == '==') {
Expand Down
4 changes: 2 additions & 2 deletions packages/freezed/lib/src/tools/type.dart
Expand Up @@ -11,7 +11,7 @@ import 'imports.dart';
/// type.alias.element
Element? _getElementForType(DartType type) {
if (type is InterfaceType) {
return type.element2;
return type.element;
}
if (type is FunctionType) {
return type.alias?.element;
Expand All @@ -27,7 +27,7 @@ String resolveFullTypeStringFrom(
}) {
final owner = originLibrary.prefixes.firstWhereOrNull(
(e) {
return e.imports2.any((l) {
return e.imports.any((l) {
return l.importedLibrary!.anyTransitiveExport((library) {
return library.id == _getElementForType(type)?.library?.id;
});
Expand Down
4 changes: 2 additions & 2 deletions packages/freezed/pubspec.yaml
Expand Up @@ -2,15 +2,15 @@ name: freezed
description: >
Code generation for immutable classes that has a simple syntax/API without
compromising on the features.
version: 2.2.0
version: 2.2.1
repository: https://github.com/rrousselGit/freezed
issue_tracker: https://github.com/rrousselGit/freezed/issues

environment:
sdk: '>=2.17.0 <3.0.0'

dependencies:
analyzer: ">=4.6.0 <6.0.0"
analyzer: ^5.2.0
build: ^2.3.1
build_config: ^1.1.0
collection: ^1.15.0
Expand Down

0 comments on commit 80a4ef0

Please sign in to comment.