Skip to content

Representation of redirecting factory bodies in Kernel AST #29841

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
peter-ahe-google opened this issue Jun 12, 2017 · 4 comments
Closed

Representation of redirecting factory bodies in Kernel AST #29841

peter-ahe-google opened this issue Jun 12, 2017 · 4 comments
Assignees
Labels
front-end-kernel legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on

Comments

@peter-ahe-google
Copy link
Contributor

To support modular compilation, we need a a way to represent redirecting factories, including the unresolved kind. I've mocked it up in Fasta in RedirectingFactoryBody.

See also #29169.

@mkustermann
Copy link
Member

When doing the kernel2kernel constants transformation I've run into this issue, since the redirecting factory constructor's body has a StaticGet(target-constructor) and my code treated all static tear-offs as constants (and there's no such thing as a constructor tear-off yet).

Also package:kernel/verifier.dart barfs on a fasta generated dill file (we use this verifier e.g. in pkg/kernel/bin/transform.dart).

If we need to preserve the information in modular compilation outputs, it seems to make sense to have a construct in Kernel IR to represent it (is it e.g. needed for dart:mirrors?).

If we decide to do it differently, e.g. by lowering factory constructors to have a body with a tailcall and a hint to not show it in stack frames, then we might not need it.

Would be wonderful if we could come up with a solution to fix this issue.

@kmillikin
Copy link

@stefantsov Could you take a look at implementing this when you get a chance?

@chloestefantsova
Copy link
Contributor

@kmillikin Sure. I plan to start working on it today.

@askeksa-google
Copy link

The representation is there. It is currently not emitted correctly, which is tracked by #28421 and #28424

@kmillikin kmillikin added legacy-area-front-end Legacy: Use area-dart-model instead. front-end-kernel and removed legacy-area-front-end Legacy: Use area-dart-model instead. front-end-kernel labels Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end-kernel legacy-area-front-end Legacy: Use area-dart-model instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

6 participants