-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
DartVM: abstract methods inheritance should be properly verified #978
Comments
Marked this as being blocked by #1031. |
This comment was originally written by [email protected] Please note that the following tests were corrected and are not related to this issue anymore |
Class C should cause a compile time error, because of the illegal override of f/1 by f/2 (I'm using the Erlang notation to distinguish methods with the same name and different arity). That rule is not expected to change. |
Note that Abstract/Methods/A04/t03 is not a compile-time error. The overriding method declares all named parameters declared by the overridden method, in the same order. It adds ana additional named parameter at the end, but that is ok. Same for Abstract/Methods/A04/t02 |
This comment was originally written by [email protected] the new relevant test names are: and rather than create a separate issue, it's probably more appropriate to add this here: |
Is this still a valid bug report? Set owner to @gbracha. |
This comment was originally written by @mhausner Yes. The VM needs to add abstract methods to classes so it can check whether they are used properly in an extending class. That will have an impact on how we handle noSuchMethod, since we can't rely on not finding the name in the class. |
Removed Priority-Medium label. |
What is the status of this one? Is Gilad still the correct owner? |
Regis, you were looking at when to throw compile-time errors from within the VM. cc @crelier. |
Abstract methods should be listed as methods of the class in the VM, as Matthias commented on May 29. However, this is not relevant to this bug report, since bad overrides are not compile-time errors anymore (unless you specify --error_on_bad_override, in which case you do not get an error either, because abstract methods are not listed). These co19 tests have the wrong expectation. They should not expect a compile-time error. Unless I miss something, this bug should be closed and a new co19 bug should be opened against these co19 tests. |
Regis, can this now be closed? If the bugs have been filed agains co19, then probably you can do so. |
I do not see any failing co19 tests related to abstract methods and I do not see any reference to issue #978. Closing issue. Added AsDesigned label. |
2021-01-24 [email protected] Issue #983: Static warning checks corrected. 2021-01-22 [email protected] Issue #983: triple-shift folders re-named correctly, typo in the library paths updated for 2 tests. 2021-01-21 [email protected] Fixes #985. LateInitializationError removed 2021-01-20 [email protected] Fixes #982. Add tests for The future value type of an asynchronous non-generator function part of NNBD spec 2021-01-19 [email protected] Issue #462: NNBD type-normalization tests for weak mode added. 2021-01-19 [email protected] Issue #462: NNBD type-aliases tests for weak mode added. 2021-01-19 [email protected] Issue #462: NNBD tripple-shift tests for weak mode added. 2021-01-19 [email protected] Issue #462: NNBD tests for weak mode added for the override checkings. 2021-01-19 [email protected] Issue #462: NNBD tests for weak mode added (Leatest-greatest-closures). 2021-01-19 [email protected] Issue #462: NNBD tests for weak mode added (Leatest-greatest-closures). 2021-01-18 [email protected] Fixes #981. Add tests for Return statements part of NNBD spec 2021-01-18 [email protected] Issue #462: NNBD tests for weak mode corrected according to the current Spec changes. 2021-01-14 [email protected] Issue #462: Additional comments regarding the constant evaluation issues added to weak mode tests. 2021-01-14 [email protected] Fixes #980. Remove warnings expectations for overriding default values of optional parameters tests 2021-01-13 [email protected] Issue #462: Tests for weak mode added to nnbd/weak/flow-analysis directory. 2021-01-12 [email protected] #978. Weak mode test changes 2021-01-12 [email protected] Issue #462: Tests for weak mode added to nnbd/weak directory. 2021-01-11 [email protected] Fixes #978. Tests updated according to the "flow analysis boolean variable" feature 2020-12-25 [email protected] Issues #463: Tests for weak mode added. 2020-12-25 [email protected] Issues #462, #463: Moved or added new nnbd tests for weak mode, added new tests for strong mode. 2020-12-24 [email protected] #970. Usr correct values for ProcessSignal.sigusr1 and ProcessSignal.sigusr2 on Mac 2020-12-24 [email protected] Issue #462: 1. Added nnbd tests for weak mode: exports_*, expression_typing_*, extension_method_resolution_*, future_flattening_*. 2. Moved and re-factored nnbd extension_method_resolution_*, future_flattening_* tests for weak mode into weak folder. 3. Copyrights updated Issue #463: Two exports* tests for strong mode added. 2020-12-24 [email protected] Fixes #496. Change tested date to 1 second instead of 1 day to reduce probability to change timezone on DST 2020-12-23 [email protected] Fixes #473. Remove UtilsHtml directory 2020-12-23 [email protected] Fix for Issue #462: 1. Added nnbd tests for weak mode: assignability_*, const_evaluation_*, const_objects_*, const_type_var_elimination_*. 2. Moved and re-factored nnbd exports_* tests for weak mode into weak folder. 2020-12-10 [email protected] Fixes #976. Remove obsolete errors expectations 2020-12-10 [email protected] Fixes #975. Fix wrong expected compile time error type 2020-12-07 [email protected] Flag Requirements=nnbd-weak added to the tests that run legacy code 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-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-release-x64-try Change-Id: I69acc5c0a28fd2e7a2d38f6c9062e5a5854bdfa6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180823 Reviewed-by: William Hesse <[email protected]>
This issue was originally filed by [email protected]
What steps will reproduce the problem?
consider the following test:
class A {
abstract f(var x);
}
class C extends A {
f(var x, var y) {}
}
main() {
new A().f(2);
new C().f(2, 2);
}
What is the expected output? What do you see instead?
Expected: compile-time error
Actual: successful compilation
What version of the product are you using? On what operating system?
DartVM r2810
Please provide any additional information below.
There are more various co19 tests:
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A03/t02
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A03/t03
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A03/t04
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A03/t05
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A04/t02
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A04/t03
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A04/t05
LangSpecTest/07_Classes/1_Instance_Methods/1/Abstract/Methods/A04/t06
The text was updated successfully, but these errors were encountered: