-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Implicit method closures aren't canonicalized #3100
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
This comment was originally written by [email protected] Pavel, maybe you check if it's related to your recent change and reassign if not? Set owner to [email protected]. |
This comment was originally written by [email protected] The problem here is that implicit method closures aren't canonicalized. Here is a reduced case: class A { main() { which prints false. Gilad, are there any plans to fix it? cc @gbracha. |
We plan to look into this issue pretty soon. And BTW, the bug is a |
…2 revisions) https://dart.googlesource.com/dartdoc/+log/d3b0b724972f..e476b1a11547 2022-07-29 [email protected] remove the height constraint on the search box (#3100) 2022-07-29 [email protected] Bump analyzer to 4.3.1 (#3099) 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: Ic52033c112052bbd2e0eda4f0f2b86786d186e9c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253041 Commit-Queue: Nate Bosch <[email protected]> Commit-Queue: DEPS Autoroller <[email protected]> Reviewed-by: Nate Bosch <[email protected]>
This issue was originally filed by @bp74
What steps will reproduce the problem?
class Test1 {
Test1() {
document.body.on.click.add(_onBodyClick);
}
_onBodyClick(event) {
print("Test1: onBodyClick");
document.body.on.click.remove(_onBodyClick);
}
}
class Test2 {
EventListener _eventListener;
Test2() {
_eventListener = _onBodyClick;
document.body.on.click.add(_eventListener);
}
_onBodyClick(event) {
print("Test2: onBodyClick");
document.body.on.click.remove(_eventListener);
}
}
void main() {
Test1 test1 = new Test1();
Test2 test2 = new Test2();
}
What is the expected output? What do you see instead?
Both classes add an EventListener to the click event of the body, but only the "Test2" class can remove the EventListener again. The funny thing is that it is the same in the Dart-VM and in all browsers when compilied to JavaSscript. It almost looks like "works as desingend" but if this is by purpose i think it should be changed.
What version of the product are you using? On what operating system?
Dart Build 7696 32 bit, Windows 7 64 bit
The text was updated successfully, but these errors were encountered: