Make dual use of a part in the same program an error.

The text still uses "with the same URI" as a proxy for "being the
same library" (as it always did). We may wish to change that to
something which will catch the case where different URIs denote the
same library.

Note that this is concerned with the specification,
the feature has been implemented in
08de1b30aa.

Closes-bug: #33225
Change-Id: I678379e98a98c2a021ce2e02c8d942c074ff583c
Reviewed-on: https://dart-review.googlesource.com/60660
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This commit is contained in:
Erik Ernst 2018-06-19 13:08:09 +00:00
parent 856c7c67ea
commit d7e5332057

View file

@ -9279,7 +9279,18 @@ It is a compile-time error if the contents of the URI are not a valid part decla
It is a static warning if the referenced part declaration $p$ names a library other than the current library as the library to which $p$ belongs.
\LMHash{}
It's a compile-time error if the same library contains two part directives with the same URI.
Let $L$ be a library.
It is a compile-time error if $L$ contains two part directives with the same URI.
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.
\commentary{
In particular, it is an error to use the same part twice in the same program
(\ref{scripts}).
}
\subsection{Scripts}