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

Error for part reuse ignores exports #34538

Closed
eernstg opened this issue Sep 21, 2018 · 1 comment
Closed

Error for part reuse ignores exports #34538

eernstg opened this issue Sep 21, 2018 · 1 comment
Assignees
Labels
area-specification type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@eernstg
Copy link
Member

eernstg commented Sep 21, 2018

The following text in dartLangSpec.tex makes it an error for a library (in particular: a program, because this rule applies to all libraries including entry points) to have two or more distinct libraries L1 and L2 in the transitive import closure such that both L1 and L2 have the same part in a part of directive:

Furthermore,
let $L_1$ be $L$ or any library which is directly or indirectly imported by $L$,
and let $L_2$ be any library distinct from $L_1$ which is directly or indirectly imported by $L$
(\ref{imports}).
It is a compile-time error if $L_1$ and $L_2$ both contain a part directive with the same URI.

This is not sufficient to achieve the intended goal, because we should cover "all parts of a program", but it is possible for a library to export another library without importing it, and this means that we can have a part of a program which is never imported by any other library.

We may be able to fix this by defining a notion of 'library dependencies' along the lines of this:
L1 er library dependent on L2 if L1 imports L2 or L1 imports L3 and L3 exports L2.

Using the transitive closure of library dependent should then suffice.

@eernstg eernstg added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-specification labels Sep 21, 2018
@eernstg eernstg self-assigned this Sep 21, 2018
@eernstg eernstg added this to To do in Dart Language Specification via automation Sep 21, 2018
@eernstg
Copy link
Member Author

eernstg commented Sep 28, 2018

Resolved by d7e5332.

@eernstg eernstg closed this as completed Sep 28, 2018
Dart Language Specification automation moved this from To do to Done Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-specification type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Development

No branches or pull requests

1 participant