mirror of
https://github.com/rrousselGit/freezed.git
synced 2025-05-17 08:25:55 +08:00
Fix diagnostics (#1226)
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -25,7 +25,5 @@ abstract class ToString with _$ToString {
|
||||
factory ToString() = _ToString;
|
||||
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'MyToString()';
|
||||
}
|
||||
String toString() => 'MyToString()';
|
||||
}
|
||||
|
@ -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 '''
|
||||
|
Reference in New Issue
Block a user