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 cross-module mixins sometimes do not inherit getters/setters. #38004

Closed
Markzipan opened this issue Aug 26, 2019 · 2 comments
Closed

CFE cross-module mixins sometimes do not inherit getters/setters. #38004

Markzipan opened this issue Aug 26, 2019 · 2 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. dev-compiler-kernel-blocker Issues that block deprecation of analyzer DDC front-end-fasta
Milestone

Comments

@Markzipan
Copy link
Contributor

Modular repro: https://dart-review.googlesource.com/c/sdk/+/114560
Ran with
dart pkg/dev_compiler/test/modular_suite.dart --configuration-name dartdevk-linux-release --verbose --filter mixin
Outputs:

dev-dart-app:/a.dart:3:7: Error: The non-abstract class 'A' is missing implementations for these members:
 - _Mix.Test
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

As a single module:

class A extends Object with Mix {}

abstract class Mix = Object with _Mix;

abstract class _Mix {
  List get Test => const ["Hello"];
}

main() {
  print(A().Test);
}

CFE (DDK) outputs [Hello].

@Markzipan Markzipan added front-end-fasta area-front-end Use area-front-end for front end / CFE / kernel format related issues. dev-compiler-kernel-blocker Issues that block deprecation of analyzer DDC labels Aug 26, 2019
@Markzipan Markzipan added this to the D26 Release milestone Aug 26, 2019
@askeksa-google
Copy link

This is a problem for dart2js modular compilation as well and is present with both the old and new class hierarchy analysis code. The _Mix class in the example doesn't have to be private to trigger the problem. I am investigating further...

@askeksa-google
Copy link

When loading a named mixin application class from dill, the cfe did not properly set the internal flag marking it as a named mixin application. This confused the class hierarchy builder, causing it to miss the inherited members.

Proposed fix: https://dart-review.googlesource.com/c/sdk/+/115218

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. dev-compiler-kernel-blocker Issues that block deprecation of analyzer DDC front-end-fasta
Projects
None yet
Development

No branches or pull requests

2 participants