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

CFE doesn't specify place of an error #45626

Closed
sgrekhov opened this issue Apr 8, 2021 · 1 comment
Closed

CFE doesn't specify place of an error #45626

sgrekhov opened this issue Apr 8, 2021 · 1 comment
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Apr 8, 2021

We have problems with the test https://github.com/dart-lang/co19/blob/master/Language/Mixins/declaration_t01.dart on CFE. The test looks like

// SharedOptions=--enable-experiment=nonfunction-type-aliases
class C {}
typedef CAlias = C;

mixin CM on C, CAlias {}
//             ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

main() {
}

It fails on CFE (tested on the edge version of SDK) with the following error

sgrekhov@SGREKHOV-HP:~/Google/dart-sdk/sdk$ out/ReleaseX64/dart-sdk/bin/dart --version
Dart SDK version: 2.13.0-edge.d6824468f90b8e0ec04abde6978a8a04acaa335a (be) (Thu Apr 8 03:27:54 2021 +0000) on "linux_x64"

sgrekhov@SGREKHOV-HP:~/Google/dart-sdk/sdk$ tools/test.py -n cfe-strong-linux co19/Language/Mixins/declaration_t01
Test configuration:
    cfe-strong-linux(architecture: x64, compiler: fasta, mode: release, runtime: none, system: linux, nnbd: strong)
Suites tested: co19

FAILED: fasta-none release_x64 co19/Language/Mixins/declaration_t01
Expected: Pass
Actual: MissingCompileTimeError
Missing expected compile error.

--- Command "fasta" (took 04.000476s):
(cd /home/sgrekhov/Google/dart-sdk/sdk/ ; DART_CONFIGURATION=ReleaseX64 ./out/ReleaseX64/dart ./pkg/front_end/tool/_fasta/compile.dart --verify --skip-platform-verification -o ./out/ReleaseX64/generated_compilations/cfe-strong-linux/tests_co19_src_Language_Mixins_declaration_t01/out.dill --platform ./out/ReleaseX64/vm_platform_strong.dill --enable-experiment=nonfunction-type-aliases --nnbd-strong --packages=./.packages ./tests/co19/src/Language/Mixins/declaration_t01.dart )

static error failures:
- Missing expected unspecified error at line 19, column 16, length 6.

--- Re-run this test:
python tools/test.py -n cfe-strong-linux co19/Language/Mixins/declaration_t01
[00:04 | 100% | +    0 | -    1]

=== 0 tests passed, 1 failed ===

But if to run it, it does produce a compile error

sgrekhov@SGREKHOV-HP:~/Google/dart-sdk/sdk$ out/ReleaseX64/dart-sdk/bin/dart --enable-experiment=nonfunction-type-aliases tests/co19/src/Language/Mixins/declaration_t01.dart
tests/co19/src/Language/Mixins/declaration_t01.dart: Error: 'C' can only be implemented once.
Try removing 1 of the occurrences.

Why CFE doesn't specify the place of an error here? I'm unable to check if test fails because we expect a CFE error in a wrong place. Usually it generates errors as

declaring_constructor_t10.dart:22:7: Error: Can't use 'M' as a mixin because it has constructors.
class C = A with M;
      ^

But not in this case. It looks like a bug in a CFE

@sgrekhov sgrekhov added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Apr 8, 2021
@johnniwinther johnniwinther added the P2 A bug or feature request we're likely to work on label Apr 8, 2021
@leafpetersen
Copy link
Member

I believe this is the same issue as #45558 - not sure if it's a test runner issue (cc @munificent ) or a front end issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants