Add `rethrow` as one of the statements that are allowed to end a switch case
without a warning.
Change wording to not claim that `throw` is a statement.
Also allow wrapping case statements in a block statement without causing
more warnings. Currently, a `case 4: { break; }` is required to warn because
the last statement is a block statement, not a break statement.
Fixes issue #27650
BUG= http://dartbug.com/27650R=eernst@google.com, floitsch@google.com, rnystrom@google.com
Review URL: https://codereview.chromium.org/2447613003 .
If the part declaration is non-empty, it will always cause a compile-time error anyway due to duplicate declarations in the library scope. This just makes it explicit that it's an error in all cases, and avoids the special case of the empty part file being silently accepted until you put something in it.
R=eernst@google.com
Review URL: https://codereview.chromium.org/2371743002 .
Now requires the type to be a supertype of `Iterable<T>`/`Future<T>`/`Stream<T>`
for some `T`. This allows, say, all `Future<T>` return types for `async` but
disallows using a different class implementing `Future`:
```
MyFuture foo() async {}
```
gives a static warning (error in Dart 2) because the return type is statically
known to be unsatisfied.
Fixes issue #27470
BUG= http://dartbugcom/27470R=eernst@google.com, floitsch@google.com
Review URL: https://codereview.chromium.org/2392513002 .
The current definition requires the expression to be valid and
compile-time constant if constructor parameters are considered
compile-time constants with types appropriate for their context.
This is necessary but not sufficient, so this CL adds the further
requirement that the expression must also be a valid (not necessarily
constant) expession if the parameters are considered non-constant
variables.
This rules out the case:
const C(x) : y = const [x];
where the current specification would, technically, allow it as a
potentially constant expression and therefore be a valid const
constructor. In practice it would never work if the constructor is
used with "new" instead of "const".
This is not really a specification *change* - existing implementations has this restriction anyway.
Addressed the concern of #24970.
BUG= http://dartbug.com/24970R=eernst@google.com, gbracha@google.com
Review URL: https://codereview.chromium.org/1465473002 .
Hash values are now computed for each "paragraph" starting with \LMHash
(which includes subsequent grammar, dartCode, itemize blocks, but stops
at \section-like commands). Now addlatexhash.dart expects three arguments
(first the source latex file, then the destination simplified and
hash-value-annotated latex source file, and finally a file name used to
create the list of hash values emitted). Adjusted testing accordingly.
Added a test for robustness of the hash value generation: It is checked
that lots of different "unimportant" changes make no difference for the
generated hash values (e.g., we can add/remove comments, change white
space, add \commentary{..} etc. without changing the hash values).
In order to ensure that all "structure" commands in the spec have a label,
I added an \LMLabel{..} a handful of places, following the style which is
used throughout the spec.
In dart.sty, the \renewcommand that made \LMHash{} produce a fixed
hash value has been removed such that the actual hash values are now
inserted into the generated spec PDF/DVI file. Tests have been adjusted
to handle this difference between the spec with and without hash values
when comparing the two.
R=gbracha@google.com, lrn@google.com, ricow@google.com
Committed: https://code.google.com/p/dart/source/detail?r=41658
Reverted: https://code.google.com/p/dart/source/detail?r=41662
Review URL: https://codereview.chromium.org//652993005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41687 260f80e4-7a28-3924-810f-c04153c831b5
Hash values are now computed for each "paragraph" starting with \LMHash
(which includes subsequent grammar, dartCode, itemize blocks, but stops
at \section-like commands). Now addlatexhash.dart expects three arguments
(first the source latex file, then the destination simplified and
hash-value-annotated latex source file, and finally a file name used to
create the list of hash values emitted). Adjusted testing accordingly.
Added a test for robustness of the hash value generation: It is checked
that lots of different "unimportant" changes make no difference for the
generated hash values (e.g., we can add/remove comments, change white
space, add \commentary{..} etc. without changing the hash values).
In order to ensure that all "structure" commands in the spec have a label,
I added an \LMLabel{..} a handful of places, following the style which is
used throughout the spec.
In dart.sty, the \renewcommand that made \LMHash{} produce a fixed
hash value has been removed such that the actual hash values are now
inserted into the generated spec PDF/DVI file. Tests have been adjusted
to handle this difference between the spec with and without hash values
when comparing the two.
R=gbracha@google.com, lrn@google.com, ricow@google.com
Review URL: https://codereview.chromium.org//652993005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41658 260f80e4-7a28-3924-810f-c04153c831b5
Introduced support for adding SHA1 hash valued location markers
at several levels in the language specification, added long explanatory
comment at the end, added a script 'addlatexhash.dart' to normalize
spacing, remove comments, etc., in the spec, such that the hash values
are more robust than they would be with a direct usage of the spec.
The script passes the "dvi2tty test", that is, when the location markers
are empty, the resulting *.dvi files created from dartLangSpec.tex and
from the version processed by the script give rise to the same text via
dvi2tty, i.e., the script does not destroy the spec.
R=gbracha@google.com, ricow@google.com
Review URL: https://codereview.chromium.org//646003002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41191 260f80e4-7a28-3924-810f-c04153c831b5