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

consider renaming deduplicated mixins and placing them into artificial libraries #43089

Open
mraleph opened this issue Aug 18, 2020 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.

Comments

@mraleph
Copy link
Member

mraleph commented Aug 18, 2020

Consider the following code:

// In package:something/one.dart
library one; 

class OneClass extends B with C { }

// In package:something_else/other.dart
library other;

class OtherClass extends B with C { }

// In package:main/main.dart
library main;

main() {
  B();
}

Due to mixing deduplication it is possible that OtherClass would be rewritten to extend _OneClass&B&C in library one - and in the resulting binary there would be objects representing Library package:something/one.dart - even though this library is not actually used.

This might be very confusing and hard to understand for users. We should consider renaming _OneClass&B&C to make class name decoupled from OneClass and we should consider moving it into an artificial library (e.g. dart:deduplicated_mixins or just dart:_internal).

Internal bug that prompted investigation: b/165124315

@mraleph mraleph added the area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. label Aug 18, 2020
@mraleph
Copy link
Member Author

mraleph commented Aug 18, 2020

/cc @alexmarkov

@mraleph
Copy link
Member Author

mraleph commented Aug 18, 2020

Alternatively we could just move class at the end of the compilation - when we know which ones of the application survived second round of tree shaking at that point if it's the last thing in the library we can just take it and move it to another library.

@lfkdsk
Copy link
Contributor

lfkdsk commented Aug 25, 2020

@mraleph #43172 try to do this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants