-
Notifications
You must be signed in to change notification settings - Fork 1.7k
with getter in superclass and setter in sublcass, warning: "Setter type 'T' must be assignable to getter type 'T'" #3067
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
Comments
Removed Area-VM label. |
Set owner to @scheglov. |
https://chromiumcodereview.appspot.com/10383251 Added Started label. |
https://code.google.com/p/dart/source/detail?r=7763 Added Fixed label. |
copybara-service bot
pushed a commit
that referenced
this issue
Jul 5, 2022
…4 revisions) https://dart.googlesource.com/dartdoc/+log/900432d8cb1e..21f9341eb662 2022-07-05 [email protected] Switch to analyzer's updateAnalysisOptions2 (#3068) 2022-07-05 49699333+dependabot[bot]@users.noreply.github.com Bump ossf/scorecard-action from 1.1.1 to 1.1.2 (#3067) 2022-07-05 [email protected] bumped analyzer version to 4.0.0 (#3033) 2022-07-05 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.1.14 to 2.1.15 (#3066) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/dart-doc-dart-sdk Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Tbr: [email protected] Change-Id: I6abe8e224af5682f96a7624e5b24a4921bf6c890 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250701 Commit-Queue: Kevin Moore <[email protected]> Commit-Queue: DEPS Autoroller <[email protected]> Reviewed-by: Kevin Moore <[email protected]>
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue was originally filed by [email protected]
STEPS TO REPRODUCE
Code like this exhibits the problem:
interface Foo<T> {
// ...
T get val();
void set val(T value);
}
class Base<T> {
// ...
T get val() {
_validate();
return _value;
}
T _value;
bool _valid;
}
class Sub<T> extends Base<T> implements Foo<T> {
void set val(T value) {
_invalidate();
_value = value;
_valid = true;
}
// T get val() => super.val
}
EXPECTED OUTPUT? OBSERVED OUTPUT?
No warning is expected, but warning appears
PRODUCT VERSION? OPERATING SYSTEM?
Dart Editor build 7552 on OS X Lion.
ADDITIONAL INFORMATION.
Adding a getter in the subclass removes the warning (see the commented-out line in Sub<T> above).
Quoting Gilad: "Looks like a bug related to typechecking generics to me. "
The text was updated successfully, but these errors were encountered: