-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Default class without constructor does not cause a compile-time error #1020
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
Hmmm. I thought we require "class F" to "implements I" in the new factory spec, if using "default F"? (Or maybe that's only required when it has generic parameters?) Removed Priority-Medium label. |
Removed Area-Frog label. |
If keeping these bugs open doesn't add any value, I'd be happy to just close them and open new ones once we start hacking on the passing negative tests for dart2js. Set owner to @peter-ahe-google. |
Added this to the M1 milestone. |
$ ./xcodebuild/ReleaseIA32/dart2js fisk.dart Added Invalid label. |
2021-03-18 irina.arkhipets@gmail.com Fixes Issue #1020: SharedOptions comment corrected. 2021-03-18 sgrekhov@unipro.ru Fixes #1014. Expect compile error on dart2js for big integers Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-x64-try Change-Id: I6ca1c23cbc3e2f7ed87efb8062c19d1b0c819bd8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191880 Auto-Submit: Alexander Thomas <athom@google.com> Reviewed-by: William Hesse <whesse@google.com> Commit-Queue: William Hesse <whesse@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`. ecosystem (https://github.com/dart-lang/ecosystem/compare/ed39318..dcf5c4f): dcf5c4f 2023-09-20 Parker Lougheed Simplify dart_flutter_team_lints install instructions (#172) http (https://github.com/dart-lang/http/compare/decefa6..1251619): 1251619 2023-09-19 Brian Quinlan Add the ability to control the URL cache. (#1020) mockito (https://github.com/dart-lang/mockito/compare/412c0be..097e563): 097e563 2023-09-19 Ilya Yanok Add a missing dummy `bool` value shelf (https://github.com/dart-lang/shelf/compare/e2a02b7..4851978): 4851978 2023-09-20 Kevin Moore shelf_router_generator: prepare to release v1.1.0 (#380) test (https://github.com/dart-lang/test/compare/6449495..8191a35): 8191a355 2023-09-20 Nate Bosch Drop a TODO about running browser after compile (#2094) d8e9d87d 2023-09-18 Nate Bosch Add a silent reporter (#2093) tools (https://github.com/dart-lang/tools/compare/70d778d..3c248df): 3c248df 2023-09-21 Devon Carew misc infra updates for dart-lang/tools (#165) Change-Id: I436a34847db75f45a20b8c18996419f88214485f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327280 Auto-Submit: Devon Carew <devoncarew@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
(clone of issue #985)
In the section 7.5 the specification says: "If no constructor is specified for a class C, it implicitly has a default constructor C() : super() {}, unless it is class Object."
In the section 8.3: "A constructor kI of I corresponds to a constructor kF of its factory class F if either F does not implement I and kI and kF have the same name, OR ... It is a compile-time error if an interface I declares a constructor kI and there is no constructor kF in the factory class F such that kI corresponds to kF ."
The test is following:
class F {
}
interface I default F {
I();
}
main() {
new I();
}
According to the specification, there is implicit constructor F():super() {} in the class F. But this is not the constructor to which constructor I() corresponds. So, a compile-time error have to occur.
this is in frog r2810
The text was updated successfully, but these errors were encountered: