Skip to content
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

Default class without constructor does not cause a compile-time error #1020

Closed
dgrove opened this issue Jan 2, 2012 · 5 comments
Closed
Assignees
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Milestone

Comments

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

(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

@jmesserly
Copy link

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.
Added Priority-Low label.

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, FromAreaFrog labels.

@kasperl
Copy link

kasperl commented Jun 12, 2012

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.
Removed FromAreaFrog label.
Added Accepted label.

@peter-ahe-google
Copy link
Contributor

Added this to the M1 milestone.
Removed Priority-Low label.
Added Priority-High label.

@peter-ahe-google
Copy link
Contributor

$ ./xcodebuild/ReleaseIA32/dart2js fisk.dart
fisk.dart:5:3: Error: cannot find constructor I in F
  I();
  ^^^^^
Error: Compilation failed.


Added Invalid label.

@dgrove dgrove added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js closed-invalid Closed as we don't believe the reported issue is generally actionable labels Jun 19, 2012
@dgrove dgrove added this to the M1 milestone Jun 19, 2012
dart-bot pushed a commit that referenced this issue Mar 18, 2021
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>
copybara-service bot pushed a commit that referenced this issue Sep 21, 2023
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>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants