26
26
%
27
27
% Significant changes to the specification.
28
28
%
29
- % 2.13 (there was no 2.12 )
29
+ % 2.12 - 2. 13 (there was no 2.11 )
30
30
% - Revert the CL where certain null safety features were removed (to enable
31
31
% publishing a stable version of the specification).
32
+ % - Add rule that a top-level pair of declarations with the same basename
33
+ % is a compile-time error except when it is a getter/setter pair.
32
34
%
33
35
% 2.8 - 2.10
34
36
% - Change several warnings to compile-time errors, matching the actual
@@ -4541,7 +4543,9 @@ \subsection{Class Member Conflicts}
4541
4543
declares a static member with basename $n$ and
4542
4544
the interface of $C$ has an instance member with basename $n$.
4543
4545
It is a compile-time error if the interface of $C$
4544
- has a method named $n$ and a setter with basename $n$.
4546
+ has an instance method named $n$ and an instance setter with basename $n$.
4547
+ It is a compile-time error if $C$ declares a static method named $n$
4548
+ and a static setter with basename $n$.
4545
4549
4546
4550
\LMHash{}%
4547
4551
When \DefineSymbol{C} is a mixin or an extension,
@@ -18232,16 +18236,17 @@ \section{Libraries and Scripts}
18232
18236
\LMHash{}%
18233
18237
A library may optionally begin with a \Index{script tag}.
18234
18238
Script tags are intended for use with scripts (\ref{scripts}).
18235
- A script tag can be used to identify the interpreter of the script to whatever computing environment the script is embedded in.
18239
+ A script tag can be used to identify the interpreter of the script to
18240
+ whatever computing environment the script is embedded in.
18236
18241
The script tag must appear before any whitespace or comments.
18237
18242
A script tag begins with \lit{\#!} and ends at the end of the line.
18238
18243
Any characters that follow \lit{\#!} in the script tag are ignored by
18239
18244
the Dart implementation.
18240
18245
18241
18246
\LMHash{}%
18242
18247
Libraries are units of privacy.
18243
- A private declaration declared within a library $L$ can only be accessed by code within $L$.
18244
- Any attempt to access a private member declaration from outside $L$ will cause a method, getter or setter lookup failure .
18248
+ A private declaration declared within a library $L$
18249
+ can only be accessed by code within $L$.
18245
18250
18246
18251
\commentary{%
18247
18252
Since top level privates are not imported,
@@ -18250,14 +18255,27 @@ \section{Libraries and Scripts}
18250
18255
18251
18256
\LMHash{}%
18252
18257
The \Index{public namespace} of library $L$ is the namespace that maps
18253
- the simple name of each public top-level member declaration $m$ of $L$ to $m$.
18258
+ the name of each public top-level member declaration $m$ of $L$ to $m$.
18254
18259
The \Index{local namespace} of library $L$ is the namespace that maps
18255
18260
the names introduced by each top-level declaration of $L$
18256
18261
to the corresponding declaration.
18257
18262
The \Index{library scope} of library $L$ is the outermost scope in $L$,
18258
18263
and its namespace is the library namespace of $L$
18259
18264
(\ref{theImportedNamespace}).
18260
18265
18266
+ \LMHash{}%
18267
+ % A setter can not be paired with a function, class, etc.
18268
+ It is a compile-time error if the local namespace of library $L$
18269
+ has two declarations with the same basename,
18270
+ except when they are a getter and a setter.
18271
+
18272
+ \commentary{%
18273
+ Two distinct names $n_1$ and $n_2$ can only have the same basename
18274
+ when they are of the form \id{} and \code{\id=},
18275
+ so this kind of conflict \emph{always} involves a setter.
18276
+ But the other declaration could be a function, a class, etc.%
18277
+ }
18278
+
18261
18279
18262
18280
\subsection{Imports}
18263
18281
\LMLabel{imports}
@@ -18795,7 +18813,7 @@ \subsection{Exports}
18795
18813
Let \NamespaceName{\metavar{merged}} be the result of applying
18796
18814
conflict merging
18797
18815
(\ref{conflictMergingOfNamespaces})
18798
- to \List{\metavar{NS}}{\metavar{one },1}{\metavar{one },m}.
18816
+ to \List{\metavar{NS}}{\metavar{exported },1}{\metavar{exported },m}.
18799
18817
A compile-time error occurs if any name in
18800
18818
\NamespaceName{\metavar{merged}}
18801
18819
is conflicted
0 commit comments