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
Add a hint- Missing warning for attempt to set the unsettable but gettable field #17166
Comments
Added Area-Analyzer, Triaged labels. |
Added this to the 1.3 milestone. |
First off, there are no warnings at all being generated. The warning that you have above, is actually a hint. In Dart only the static types are used to generate warnings. In this case f and b are both dynamic since they are declared with 'var'. If the 'var's are changed to the type, warnings appear in both cases. class Foo { Leaving the issue open to create the missing hint on 'foo'. Also- All hint related issues are being marked as Milestone-Later. cc @bwilkerson. |
This comment was originally written by @tatumizer
|
I forgot to say thank you for the feedback. I'm not disagreeing with you, and we'll add it as soon as we can spend more time on hints. If you are interested in contributing to the analyzer, it is open source, we'd be happy to have external contributors! The change to add this missing hint won't be hard, just a bit tedious. |
This comment was originally written by @tatumizer No problem :-). I know you are working hard guys. I couldn't be even 1/10 |
Added Analyzer-Hint label. |
Changed the title to: "Add a hint- Missing warning for attempt to set the unsettable but gettable field". |
Removed Type-Defect label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
This is implemented as a strong mode warning.
|
This issue was originally filed by @tatumizer
class Foo {
get foo=>null;
}
class Bar {
var _bar;
set bar(x)=>_bar=x;
}
main() {
var f=new Foo();
f.foo=1; // no warning
var b=new Bar();
print(b.bar); // warning!
}
Attempt to get the ungettable but settable field is flagged, but the reverse is not true
The text was updated successfully, but these errors were encountered: