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

no compile-time error for wrong interface methods overriding #1019

Closed
dgrove opened this issue Jan 2, 2012 · 7 comments
Closed

no compile-time error for wrong interface methods overriding #1019

dgrove opened this issue Jan 2, 2012 · 7 comments
Assignees
Labels
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

(cloned from issue #970, which reports this issue for the VM)

What steps will reproduce the problem?
consider the following test:
interface I {
  void m1();
}

interface J extends I {
  void m1(int i);
}

main() {
  J j = null;
  try {j.m1(null);} catch (var e) {}
}

What is the expected output? What do you see instead?
Expected: compile-time error
Actual: successful completion

Please provide any additional information below.
co19 tests:
LangSpecTest/08_Interfaces/1/Methods/A03/t01
LangSpecTest/08_Interfaces/1/Methods/A03/t02
LangSpecTest/08_Interfaces/1/Methods/A03/t03
LangSpecTest/08_Interfaces/1/Methods/A03/t04
LangSpecTest/08_Interfaces/1/Methods/A04/t01
LangSpecTest/08_Interfaces/1/Methods/A04/t02
LangSpecTest/08_Interfaces/1/Methods/A04/t03
LangSpecTest/08_Interfaces/1/Methods/A04/t04
LangSpecTest/08_Interfaces/1/Methods/A04/t05

@anders-sandholm
Copy link
Contributor

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

@kasperl
Copy link

kasperl commented Jun 12, 2012

I believe dart2js has this problem too.


Set owner to @peter-ahe-google.
Removed FromAreaFrog label.
Added Accepted label.

@peter-ahe-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-High label.

@peter-ahe-google
Copy link
Contributor

Added this to the M1 milestone.

@peter-ahe-google
Copy link
Contributor

Added Started label.

@peter-ahe-google
Copy link
Contributor

I have a preliminary fix here: https://chromiumcodereview.appspot.com/10661029/

Outstanding issues: compiler crashes on cyclic typedefs, the compiler parses class headers twice (this may not be a big deal, actually.

@peter-ahe-google
Copy link
Contributor

This was fixed in r10677.

However, notice that the particular example in the first comment on this bug is a bad test. It assumes that an implementation eagerly load (and validate) classes. I will report this as a bug against the co19 test suite.

dart2js will only validate supertypes of instantiated classes. Long term, dart2js will have an option to validate/compile everything.


Added Fixed 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 labels Aug 14, 2012
@dgrove dgrove added this to the M1 milestone Aug 14, 2012
dart-bot pushed a commit that referenced this issue Apr 7, 2021
2021-04-07 [email protected] Fixes #535: more nnbd tests for constant evaluation added.
2021-04-07 [email protected] Fixes #1068. Remove excessive - in a SharedOptions
2021-04-05 [email protected] Fixes #535: more nnbd tests for constant evaluation added.
2021-04-05 [email protected] Fixes #996: more tests added.
2021-04-05 [email protected] Fixes #996: more tests added.
2021-04-05 [email protected] Fixes #1067: added checks for old and new dart versions.
2021-04-05 [email protected] Fixes #1066: added @Dart=2.12 to the initial version of the test, new test which checks recent dart behavior added.
2021-04-05 [email protected] Fixes #1057: Expected result doe the tests with mailformed types updated.
2021-04-02 [email protected] Fixes #1062. Remove unnecessary assignment
2021-04-01 [email protected] Fixes #1057: Expected result doe the tests with mailformed types updated.
2021-04-01 [email protected] Expected error code is fixed for Windows
2021-04-01 [email protected] Fixes #1060. Expected error message position updated
2021-04-01 [email protected] Fixes #1059. Expected error message updated
2021-04-01 [email protected] Fixes #1024. Adjust expected results for web platforms
2021-04-01 [email protected] #993. More Array tests added
2021-03-31 [email protected] Update LICENSE
2021-03-31 [email protected] #993. Array tests added
2021-03-31 [email protected] Issue #1053: Missing Issue tag added, test expectation updated.
2021-03-30 [email protected] Fixes #1054: Updated expectations for mailformed raw type variables.
2021-03-30 [email protected] Fixes #1050: Updated expectations for mailformed raw type variables.
2021-03-30 [email protected] Fixes #1050: Got rid of mailformed row type variable usage in i-2-b- tests.
2021-03-29 [email protected] Fixes #1043. Remove static warning as an expected result
2021-03-29 [email protected] Fixes #1049: Correct expectation adjusted
2021-03-29 [email protected] Fixes #1048. Move tests to correct folder and change the description
2021-03-29 [email protected] Fixes #1046: Test adjusted to work with the generic metadata feature enabled.
2021-03-29 [email protected] Fixes #1047. Change expected result to not to fail on JavaScript configurations
2021-03-29 [email protected] Fixes #1044. Change expected result to not to fail on JavaScript configurations
2021-03-26 [email protected] Fixes #1029: Missing Issue tag added to the test.
2021-03-26 [email protected] Fixes #1042. Add check that produces different results for triple and double shifts
2021-03-26 [email protected] Fixes #1042. Fix built-in_types_t11.dart to expect correct results
2021-03-25 [email protected] Fixes #1019. Don't use type aliases in legacy libraries
2021-03-25 [email protected] Fixes #1039: Old-style aliases corrected.
2021-03-25 [email protected] Fixes #988. Expect static type warning in a right way
2021-03-24 [email protected] Issues #1029: Static expectation corrected.
2021-03-24 [email protected] Issues #1035: Issue tag for the bug 45443 added.
2021-03-24 [email protected] Merge branch 'master' of https://github.com/dart-lang/co19
2021-03-24 [email protected] #1023. Change SplayTreeMap and SplayTreeSet tests according to the new behavior
2021-03-23 [email protected] #1021. Remove expecting errors on web configurations for some negative numbers
2021-03-23 [email protected] Fixes #1034. Missed experimental flag added
2021-03-23 [email protected] #1033. Perform runtime check on big values for non-JavaScript configurations only
2021-03-23 [email protected] Issues #1029: co19/Language/Generics/Superbounded_types/typedef3_A01_t06/02 corrected and does not expect a compile error now.

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: I5fae01c7b48aba502da04638430f4f6de79ac745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194241
Reviewed-by: William Hesse <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 14, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (https://github.com/dart-lang/ecosystem/compare/e96fbdb..babf5d1):
  babf5d1  2023-09-13  Devon Carew  add additional lints to dart_flutter_team_lints (#167)
  7740bef  2023-09-13  Moritz  Write comments on forks for `firehose` (#165)

http (https://github.com/dart-lang/http/compare/de19214..e19094a):
  e19094a  2023-09-14  Brian Quinlan  Use efficient operations when copying bytes between Dart and Java (#1019)
  d7e4375  2023-09-13  Parker Lougheed  Cleanup `package:http` utils (#1011)
  eafbbb0  2023-09-12  Brian Quinlan  Separate the cronet callbacks from the `send` method (#1017)
  2cbb703  2023-09-12  Brian Quinlan  Switch `cronet_http` to use jnigen (#1016)

native (https://github.com/dart-lang/native/compare/bbcbc1f..7faf62c):
  7faf62c  2023-09-14  Gabriel Terwesten  Add `includes`, `flags`, `std`, `language`, `cppLinkStdLib` options (#125)

shelf (https://github.com/dart-lang/shelf/compare/2926f76..e2a02b7):
  e2a02b7  2023-09-13  Kevin Moore  Move to latest pkg:dart_flutter_team_lints, bump min sdk to Dart 3 (#378)

tools (https://github.com/dart-lang/tools/compare/fa01f9b..1512f3d):
  1512f3d  2023-09-13  Elias Yishak  Add Fake Analytics instance that uses list to save events sent (#149)

webdev (https://github.com/dart-lang/webdev/compare/6b21ecf..501ccc2):
  501ccc28  2023-09-12  Elliott Brooks  Update DCM triggers to match Dart DevTools (#2230)

Change-Id: Ic3dc1924da48454a28e4c0d8705244ac1565e74a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325967
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants