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

TFA does not correctly handle case when static field is only written and never read #35632

Closed
kangwang1988 opened this Issue Jan 11, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@kangwang1988
Copy link

kangwang1988 commented Jan 11, 2019

@mraleph
This issue comes up from flutter/flutter#26417
I've dug more and find it's because of callstack below:

image

flutter doctor -v as below:

KWLM:doctor -v
[✓] Flutter (Channel master, v1.1.10-pre.37, on Mac OS X 10.14.3 18D32a, locale en-CN)
    • Flutter version 1.1.10-pre.37 at /Users/kylewong/Codes/Flutter/alibaba-flutter/flutter
    • Framework revision 5a434c61a (11 hours ago), 2019-01-11 10:05:35 +0800
    • Engine revision e5ec3cf3ea
    • Dart version 2.1.1 (build 2.1.1-dev.0.1 2cb346bd0c)
@mraleph

This comment has been minimized.

Copy link
Contributor

mraleph commented Jan 11, 2019

Reduction:

class A {
}

var field = A();

void main() {
  field = null;
}

@alexmarkov could you take a look? I think TFA does not handle the case when field is only written, but never read correctly.

@mraleph mraleph changed the title dart compiler works fine for debug but fail for release(tree-shaking related?) TFA does not correctly handle case when static field is only written and never read Jan 11, 2019

@alexmarkov

This comment has been minimized.

Copy link
Contributor

alexmarkov commented Jan 11, 2019

Thank you for triaging and short reduction.
The fix is sent out for review: https://dart-review.googlesource.com/c/sdk/+/89161

@dart-bot dart-bot closed this in d821a2e Jan 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment