mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:07:06 +00:00
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:
parent
856c7c67ea
commit
d7e5332057
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue