- Typed array elements are never null, but type inference sometimes
thinks they are.
- Annotated isNan and isFinite as pure.
Change-Id: I5fffd237374444db27665009cf550b26563bcf55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98046
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Since we already have support for Block in our visitors, we can extend
them to support BlockExpression fairly easily.
co19_2 and language_2 tests still need to be unskipped, but we can't do
that until CFE respects the --enable-experiment=control-flow-collections
flag.
Change-Id: I48da19cc33dbf35c5ead3ea13266b01d3e0de959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97820
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
There is nothing constructing a `ConstantUse` through any path with a
use kind of `Indirect`.
- Remove the kind field and the only place reading it. Treat it as
always `DIRECT`.
- Remove the unused `mirrors` and `typeVariableMirror` constructors.
- Preserve other named constructors even though they behave identically to avoid
losing context at use sites.
- Make the `hashCode` getter lazy since it is only forwarding to the `value`.
Change-Id: I69a36fac245c74794b65e617b8cdd445a937bbee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97343
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Nothing is reading this option.
- Change the option handler to ignore to avoid breaking users passing it
anyway.
- Remove the Flag constant.
- Remove the option.
Change-Id: I62f3b6ce7b3cf38ad310576b011d27ac78353fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97346
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Where we have an `@override` which duplicate's the super types doc
comment it is not adding anything useful and can be removed.
Also do some minor comment cleanup where feasible:
- Introduce blank lines following the first sentence to follow effective
dart guidelines.
- Change non-doc comments to use two slashes.
- Where comments were improved after being pasted, bring the improvement
to the original comment.
- Move comments where there was no comment on the super type but the
subtype comment clearly applied.
Change-Id: I61b5eca79f692641ce96c5c9d26fa3731c8e230e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97008
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
TBR=askesc@google.com
Revert "[CFE] Move constant evaluator to Fasta."
This reverts commit 845b5b2df1.
Revert "[CFE] Always call the constant evaluator by the evaluate method."
This reverts commit 91bc4ec2b9.
Revert "[CFE] Use Fasta diagnostics in the constant evaluator."
This reverts commit c7b572aa29.
Revert "[CFE] Check for null in constant evaluation"
This reverts commit e6d2751e9c.
Revert "Rename import after moving file."
This reverts commit a6e2c5eb4c.
Change-Id: Iadfe087c0110f6f331b82d990213f95d3ef4541b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97223
Reviewed-by: William Hesse <whesse@google.com>
This is in preparation for recognizing Fasta-specific nodes in the
constant evaluator, and for using the Fasta diagnostics framework.
Change-Id: I8535fbb68e622f1814a1d577c348d87e573b6b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96081
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This makes it easier to follow class hierarchies and understand where a
class is changing the interface. I hit this when I found a class that
had the annotation on some methods it was overriding, but not all, which
made it confusing.
Prepares for adding the lint rule and enforcing it.
40% of overridden methods were annotated - add annotations to the remaining 60%.
Change-Id: I02472f4b6c5026a820cf9ff1a7ada663a60f1868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96666
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This preserves the invariant that method invocations and property sets
with an interface target handle static types at the call site.
This is a prerequisite to improving dart2js with implicit checks.
With this we can mark dynamic invocations a statically safe and
discover when instance methods don't need to check parameter types.
Change-Id: Ife7a3f947952b3c1f73316b922b2aa107343068e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This is a reland of c2b466b09f
Original change's description:
> [CFE] Move constant evaluation number semantics handling to front end.
>
> JavaScript number semantics is currently implemented as the simplistic
> version previously present in DDC. This is a starting point for fully
> detailed JS number semantics.
>
> Change-Id: Id728b3dacec892a5cbf7ece0d9faea51427f5f9b
> Reviewed-on: https://dart-review.googlesource.com/c/94746
> Commit-Queue: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: I1a488ef41bda819d34cb45cd481fd8fd88bfb01e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>