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

Some suggested corrections of the tests for the named-arguments-anywhere language features #1240

Closed
chloestefantsova opened this issue Dec 1, 2021 · 0 comments
Assignees

Comments

@chloestefantsova
Copy link
Contributor

Some of the tests for the named-arguments-anywhere language feature aren't passing. I looked into them, and I think the tests should be updated.

Test co19/LanguageFeatures/Named-arguments-anywhere/constructor_t08

In this test the error is due to class A having a default constructor instead of the one taking three arguments. I think it's just a typo, and if C is corrected to A in line 20, the test passes.

class A<T> {
String log = "";
C(T x, T y, {T? z}) {
log = "x=$x, y=$y, z=$z";
}
}

Test co19/LanguageFeatures/Named-arguments-anywhere/constructor_t06

I think the failure in this test is due to the typo too: in line 28 it should say T x (with the space) instead of Tx.

Test co19/LanguageFeatures/Named-arguments-anywhere/constructor_t02

The failures in this test are in the lines where the type argument is paced after the name of the named constructor. I think it should be a compile-time error indeed, and the argument should to after the name of the class and before the name of the constructor. CC-ing @eernstg to confirm.

Expect.equals("x=1, y=2, z=3", C.named<int>(1, 2, z: 3).log);
Expect.equals("x=1, y=2, z=3", C.named<int>(z: 3, 1, 2).log);
Expect.equals("x=1, y=2, z=3", C.named<int>(1, z: 3, 2).log);

@sgrekhov sgrekhov self-assigned this Dec 1, 2021
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Dec 7, 2021
2021-12-07 [email protected] dart-lang/co19#932. HttpRequestUpload tests fixed
2021-12-06 [email protected] Issue dart-lang/co19#1094: Runtime executable mode checks moved to Utils/Expect, Language/Libraries_and_Scripts/Scripts, LibTest/io/Process tests corrected.
2021-12-03 [email protected] Issue dart-lang/co19#1239: in LibTest/io/Process/run_A01_t03 isDartkp is a getter now.
2021-12-03 [email protected] Subtype test added testing 500 elements deep transitivity
2021-12-02 [email protected] Issue dart-lang/co19#1239: typo corrected in LibTest/io/Process/run_A01_t03
2021-12-02 [email protected] Fixes dart-lang/co19#1241. Missed return statements added
2021-12-02 [email protected] Fixes dart-lang/co19#1240. Typos fixed in Named arguments anywhere tests
2021-12-01 [email protected] More fix for dart-lang/co19#1094: LibTest/io/Process/run_A01_t03 test corrected: exit code for precompiled runtime should be 255

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-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I96860dcd3b42d56d2a0c202e1e5fbc251b92106a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222202
Reviewed-by: William Hesse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants