Skip to content

LanguageFeatures/Enhanced-Enum/enum_name_A01_t01 #1269

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

Closed
alexmarkov opened this issue Jan 13, 2022 · 1 comment
Closed

LanguageFeatures/Enhanced-Enum/enum_name_A01_t01 #1269

alexmarkov opened this issue Jan 13, 2022 · 1 comment
Assignees

Comments

@alexmarkov
Copy link

This test assumes that default constructor is added automatically into the enum class when there is a user-defined generative constructor:

enum E<T extends num> {
e1,
e2(),
e3<int>.named(42);
const E.named(int x);
}

However, according to the spec, this is not the case:

https://github.com/dart-lang/language/blob/bdbef03e26047a1f59152f97d23663cf93a7108e/accepted/future-releases/enhanced-enums/feature-specification.md?plain=1#L99-L106

So declarations of elements e1 and e2 in this test are incorrect.

@alexmarkov
Copy link
Author

Same problem is in the LanguageFeatures/Enhanced-Enum/grammar_A04_t05 test:

enum E<T> {
e1,
e2(),
e3<int>.named(42);
const E.named(int x);
int foo(covariant int x) => x;
}

@sgrekhov sgrekhov self-assigned this Jan 14, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jan 20, 2022
2022-01-19 [email protected] Fixes dart-lang/co19#1275: Test expectations corrected.
2022-01-18 [email protected] Fixes dart-lang/co19#1274: LanguageFeatures/Super-parameters/summary_A04_t02 test corrected: Expect.approxEquals is used instead of Expect.equals for the double comparing.
2022-01-18 [email protected] Issue dart-lang/co19#1244: LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A06_t01 test should not run for dart2js because it uses mirrors.
2022-01-14 [email protected] dart-lang/co19#1262. Roll failures fixed
2022-01-14 [email protected] dart-lang/co19#1258. Enhanced Enums semantics tests added
2022-01-14 [email protected] Fixes dart-lang/co19#1269. Missed default constructor added to enum declaration
2022-01-14 [email protected] Fixes dart-lang/co19#1273. Typo fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1271. Typo fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1270. Fix expected result values
2022-01-14 [email protected] Fixes dart-lang/co19#1268. Runtime type check fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1267. Error expectation added
2022-01-14 [email protected] Fixes dart-lang/co19#1266. Default value added to non-nullable parameter
2022-01-14 [email protected] Fixes dart-lang/co19#1272. Runtime type check fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1265. Invalid assignment fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1264. Super parameter name fixed
2022-01-14 [email protected] Fixes dart-lang/co19#1263. Add default value to non-nullable parameter
2022-01-13 [email protected] dart-lang/co19#1258. Enhanced Enums semantics tests rewritten according to changed spec

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: I7001196297890f485f4b506898fff8cff1b3a0d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228646
Reviewed-by: William Hesse <[email protected]>
Commit-Queue: Alexander Thomas <[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