Fix diagnostics (#1226)

This commit is contained in:
Remi Rousselet
2025-04-05 12:50:33 +02:00
committed by GitHub
parent 0858cb952f
commit 714b2fdc37
4 changed files with 8 additions and 8 deletions

View File

@ -17,12 +17,11 @@ jobs:
matrix:
package:
- packages/freezed
- packages/freezed/example
- packages/freezed_annotation
- packages/freezed_lint
channel:
- master
# BLocked by https://github.com/dart-lang/source_gen/issues/739
# - stable
dependencies:
- get
- downgrade
@ -38,7 +37,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
cache: ${{ matrix.channel == 'stable' }}
cache: ${{ matrix.channel == 'master' }}
# It is executed separately
- name: Removing example folder

View File

@ -2,6 +2,7 @@
- Fix ==/hashCode when using inheritance.
The generated ==/hashCode now call `super == other` when necessary.
- Fix an issue with `Diagnosticable` and `toString`
## 3.0.4 - 2025-03-16

View File

@ -25,7 +25,5 @@ abstract class ToString with _$ToString {
factory ToString() = _ToString;
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'MyToString()';
}
String toString() => 'MyToString()';
}

View File

@ -33,8 +33,10 @@ class Abstract {
.expand((e) => [e.abstractGetter, if (!e.isFinal) e.abstractSetter])
.join();
var interfaces =
[if (globalData.hasDiagnostics) 'DiagnosticableTreeMixin'].join();
var interfaces = [
if (globalData.hasDiagnostics && data.options.asString)
'DiagnosticableTreeMixin'
].join();
if (interfaces.isNotEmpty) interfaces = ' implements $interfaces';
return '''