-
Notifications
You must be signed in to change notification settings - Fork 28
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
In checked mode, void
now allows every value
#110
Comments
Will fix this when 1.25 became available |
This change should already be in 1.24 (which should get released soon). Fyi: here is the commit that updated the spec: https://codereview.chromium.org/2875643002/ |
@floitschG thank you. I've fixed this issue in co19 master branch. But what about strong mode? What should happen in this case in a strong mode? |
Take the following example: void foo(A o) => o.bar();
class A { void bar() {} }
class B extends A { int bar() => 499; } It's completely legal (both in strong and non-strong mode). Before this change, the checked-mode variant would fail, when In strong mode, the code is correctly typed, and DDC (as well as strong mode) wouldn't even add a check. As such, it should behave the same way. Currently, DDC does not check for The following example does not raise any errors in DDC. int bar() { print("in bar"); return 499; }
void foo(Function f) => f();
main() {
foo(bar);
} Our general approach is, that @vsmenon, @leafpetersen , in case they have more comments. |
@floitschG thank you. I've fixed this issue in a strong mode branch as well. Please note, that this functionality is still not supported by analyzer. I added comment about this to dart-lang/sdk#28935 |
* DEPS ans status files updated to the last co19 commit * Commented lines deleted from .status file * DEPS ans status files updated to the last co19 commit * DEPS ans status files updated to the fix of dart-lang/co19#110 * Fix for dart-lang/co19#87 added * Fix for dart-lang/co19#88 added
* DEPS ans status files updated to the last co19 commit * Commented lines deleted from .status file * DEPS ans status files updated to the last co19 commit * DEPS ans status files updated to the fix of dart-lang/co19#110 * Fix for dart-lang/co19#87 added * Fix for dart-lang/co19#88 added * Status files updated according to buildbot log
As per dart-lang/sdk#28935, Dart will now allow any value for
void
.I'm in the process of committing the changes to dart2js and the VM.
The spec is not yet updated (dart-lang/sdk#28936), but the change should be pretty simple.
The following tests are affected by this change:
The text was updated successfully, but these errors were encountered: