diff --git a/CHANGELOG.md b/CHANGELOG.md index efe41afd..b69ab30a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# 8.12.4 + +- Reduce use of dynamic calls in generated `operator==` when there are + functions: only use dynamic calls if the class also has type parameters. + # 8.12.3 - Require `analyzer ^10.0.0`, stop using removed and deprecated methods from diff --git a/benchmark/pubspec.yaml b/benchmark/pubspec.yaml index 013524e8..3679cde5 100644 --- a/benchmark/pubspec.yaml +++ b/benchmark/pubspec.yaml @@ -1,5 +1,5 @@ name: benchmark -version: 8.12.3 +version: 8.12.4 publish_to: none description: > Benchmark, not for publishing. @@ -14,7 +14,7 @@ dependencies: dev_dependencies: build_runner: '>=1.0.0 <3.0.0' - built_value_generator: ^8.12.3 + built_value_generator: ^8.12.4 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0 diff --git a/built_value/pubspec.yaml b/built_value/pubspec.yaml index 689539dc..941b3733 100644 --- a/built_value/pubspec.yaml +++ b/built_value/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value -version: 8.12.3 +version: 8.12.4 description: > Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency. diff --git a/built_value_generator/pubspec.yaml b/built_value_generator/pubspec.yaml index ddcfb874..251fda2a 100644 --- a/built_value_generator/pubspec.yaml +++ b/built_value_generator/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value_generator -version: 8.12.3 +version: 8.12.4 description: > Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency. diff --git a/built_value_generator/test/built_value_generator_test.dart b/built_value_generator/test/built_value_generator_test.dart index 74d379d3..a77278c2 100644 --- a/built_value_generator/test/built_value_generator_test.dart +++ b/built_value_generator/test/built_value_generator_test.dart @@ -882,8 +882,7 @@ abstract class NestedValue implements Built { test('uses dynamic for equality check on function fields with generics', () async { - expect( - await generate('''library value; + expect(await generate('''library value; import 'package:built_value/built_value.dart'; part 'value.g.dart'; abstract class Value implements Built, ValueBuilder> { @@ -891,15 +890,13 @@ abstract class Value implements Built, ValueBuilder> { factory Value([void Function(ValueBuilder) updates]) = _\$Value; void Function(T) get callback; } -'''), - contains(r'final dynamic _$dynamicOther = other;')); +'''), contains(r'final dynamic _$dynamicOther = other;')); }); test( 'does not use dynamic for equality check on function fields without generics', () async { - expect( - await generate('''library value; + expect(await generate('''library value; import 'package:built_value/built_value.dart'; part 'value.g.dart'; abstract class Value implements Built { @@ -907,8 +904,7 @@ abstract class Value implements Built { factory Value([void Function(ValueBuilder) updates]) = _\$Value; void Function(int) get callback; } -'''), - isNot(contains(r'dynamicOther'))); +'''), isNot(contains(r'dynamicOther'))); }); test('cleans generated class names for private classes', () async { diff --git a/built_value_test/pubspec.yaml b/built_value_test/pubspec.yaml index 535317a0..6d894de4 100644 --- a/built_value_test/pubspec.yaml +++ b/built_value_test/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value_test -version: 8.12.3 +version: 8.12.4 description: > Value types with builders, Dart classes as enums, and serialization. This library provides test support. @@ -21,7 +21,7 @@ dependencies: quiver: '>=0.21.0 <4.0.0' dev_dependencies: - built_value_generator: ^8.12.3 + built_value_generator: ^8.12.4 build_runner: '>=1.0.0 <3.0.0' pedantic: ^1.4.0 test: ^1.0.0 diff --git a/chat_example/pubspec.yaml b/chat_example/pubspec.yaml index 9ff06f88..d3bc24f4 100644 --- a/chat_example/pubspec.yaml +++ b/chat_example/pubspec.yaml @@ -1,5 +1,5 @@ name: chat_example -version: 8.12.3 +version: 8.12.4 publish_to: none description: > Just an example, not for publishing. @@ -21,6 +21,6 @@ dev_dependencies: build_runner: any build_test: any build_web_compilers: any - built_value_generator: ^8.12.3 + built_value_generator: ^8.12.4 pedantic: ^1.4.0 test: ^1.0.0 diff --git a/end_to_end_test/pubspec.yaml b/end_to_end_test/pubspec.yaml index 70d37617..30719861 100644 --- a/end_to_end_test/pubspec.yaml +++ b/end_to_end_test/pubspec.yaml @@ -1,5 +1,5 @@ name: end_to_end_test -version: 8.12.3 +version: 8.12.4 publish_to: none description: > Tests, not for publishing. @@ -15,7 +15,7 @@ dependencies: dev_dependencies: build: '>=3.1.0 <5.0.0' build_runner: '>=2.5.0 <3.0.0' - built_value_generator: ^8.12.3 + built_value_generator: ^8.12.4 fixnum: ^1.0.0 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b1862ba1..a27b85e3 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: dev_dependencies: build_runner: '>=1.0.0 <3.0.0' - built_value_generator: ^8.12.3 + built_value_generator: ^8.12.4 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0