Commit Graph

2004 Commits

Author SHA1 Message Date
Jens Johansen 752abb5f38 [CFE] Temporarily don't require a dill to exist for the current kernel version
Change-Id: Ie69127a708193b5d07cf08ce717845204d1647ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122785
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-24 12:13:33 +00:00
Johnni Winther 33cb6c0a15 [cfe] Skip newly added type promotion tests
Change-Id: Ifc1eba46fd7a71be0b333a6d21f34e03c46b6c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122781
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-24 11:15:39 +00:00
Johnni Winther 63d524dec0 [cfe] Add skeleton for testing nullability, definite assignment and type promotion
Change-Id: I8eab67deb401496af5a5aee3a44831a8ade55a1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122641
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-24 09:23:06 +00:00
Paul Berry 23dda7c6bc Fix an analyzer corner case with compound assignments.
When analyzing an expression like `x += y`, where `x` may be type
promoted, we need to consider x's unpromoted type when determining
whether the result of the addition may be assigned to `x`.  Before
flow analysis, we didn't need to worry about this subtlety because the
appearance of `x` on the LHS of an assignment used to disqualify it
from type promotion within any scopes containing the assignment.

Change-Id: I17887c457c9d0ce17ce704884e04d93ca8a3e925
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122587
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-23 22:37:57 +00:00
Paul Berry 92c69f224b Flow analysis: promote on successful execution of an "as" expression.
Change-Id: I506281ab2dfe23b4b75daf795028fec979006932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122586
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-23 17:02:37 +00:00
Paul Berry 5837c65b6e Flow analysis: test unreachability for constructor initializers.
This was already working, it just needed some updates to the test
infrastructure so we could test it properly.

Change-Id: Ie838fb50cf90aabd19c6e0c637df546ddcda16d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122584
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Paul Berry 8e23f76ac7 Flow analysis: properly handle promotion of type parameters.
When promoting a type parameter, we need to create an intersection
type (e.g. "T & int").  Such a type is represented in the analyzer and
the front end as a type parameter type pointing to the same type
variable, but with a different bound.

Change-Id: I1655f9242d913ca958c279cc80c3f6329f6b396d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Paul Berry 06a8577de2 Flow analysis: recursively annotate unreachable nodes in test
Previously, in the flow analysis reachability tests, we only annotated
a node as unreachable if it wasn't "covered" by a parent node that was
already marked as unreachable.  This made the tests more compact, but
it meant that the testing was less complete, because it meant that we
weren't verifying that the nodes inside of unreachable nodes were also
unreachable.

This CL changes the tests so that we mark every unreachable node as
unreachable, with one small exception: for an expression statement, we
don't mark the expression; we just mark the statement as unreachable,
and we have an assertion in the data extractor to verify that the
expression's reachability matches that of the statement.

Change-Id: I92454c72e9704b34e2dbafb9f5f19a8ee31f8f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122583
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Johnni Winther 2727fd9b3c [cfe] Add helper for creating property set
The use of the helper removed the creation some unneeded temporary
variables in extension access which is reflected in the expectation
changes.

Change-Id: Ice6afcb223b7740c2555a076c3ddae9a9d4f092d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122394
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-23 12:23:53 +00:00
Paul Berry 0887806796 Flow analysis: introduce TypeOperations.tryPromoteToType method.
Previously, any attempt to promote type A to type B produced type B if
B was a subtype of A, and failed otherwise.  But in order to support
promotion of type parameters, we need the ability to produce a fresh
"intersection type" (e.g. `T & int`).  The new
`TypeOperations.tryPromoteToType method` makes this possible by giving
the client the opportunity to synthesize the new type when necessary.

Change-Id: If671d5d865f38469a878329180c3a1c94e25a42c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122582
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-23 11:12:21 +00:00
Paul Berry dfddeada02 Flow analysis: treat expressions of type Never as unreachable.
Change-Id: I4e6c629e4f9f8ebba3c7b2168b421a723c69928b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122417
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-23 05:52:26 +00:00
Paul Berry 4ab09db0f4 Analyzer flow analysis for null-aware operators.
The front end implementation is in a previous CL
(https://dart-review.googlesource.com/c/sdk/+/122415).  This CL
contains the analyzer implementation and the integration tests.

Note that the analyzer implementation of null shorting is incomplete,
so some corner cases couldn't be tested.  I'll be fixing this in
follow-up CLs.

Change-Id: I0935ee4c67b24f8bf7c70cbb7ec56dd826fbf73a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122416
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-22 19:18:16 +00:00
Paul Berry 689c934406 Flow analysis: add support for null-aware accesses.
Change-Id: I4367a1dd23d981b885a48d7fbe129d2288787a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122415
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-22 19:18:16 +00:00
Jens Johansen 0449905e2d [CFE] Add a serialization-and-unserialization step to strong test
Change-Id: Icb6275e9eaec0bbdd890719d780a0218fa660fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-22 13:40:01 +00:00
Johnni Winther b26127fe01 [cfe] Add reachability test skeleton
Change-Id: Iac74d450816f1781512d44d533464e7c9857fed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122388
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-22 12:26:31 +00:00
Paul Berry aeede3c1b0 Flow analysis: pass catch variables to tryCatchStatement_catchBegin.
Previously, it was the caller's responsibility to call initialize()
for any variables declared in a catch block.  Now this is done
automatically.

Change-Id: If9c586e12f7d114517476e56e984d16a570648e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122413
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-22 10:56:54 +00:00
Paul Berry 1e7bfd6449 Sort declarations in flow_analysis_test.dart
Change-Id: Ie82537ffe4daa41ca9a15436d8f0788b1c1cfe8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122412
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-22 10:56:54 +00:00
Paul Berry 9579c4bc3c Flow analysis: simplify use of isExpression_end.
Previously, it was the caller's responsibility to determine if the
subexpression of an "is" expression was a read of a promotable
variable.  Now, the caller calls isExpression_end regardless of what
the subexpression is, and flow analysis determines whether promotion
should happen or not.

Change-Id: Ibba689935580d4e9c5ab79e5afb534c173386232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122411
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-22 10:56:54 +00:00
Johnni Winther e76f6d49e4 [cfe] Implement null-shorting for most expressions
Binary operations and parenthesized expression are shorted which they
shouldn't be. Also, so complex expressions, like compound assignment,
are not handled because they need to be encoded in a more high-level
internal expression to support choosing the receiver based on shorting.

Change-Id: I0bdeabdc21da7d80f533ea0880662bfb11341c6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121856
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-22 10:04:54 +00:00
Karl Klose 74d0282179 [infra] Run test suites in pkg/front_end/test with custom test runner
Some tests in pkg/frontend/test are actually test suites written using the
pkg/testing framework.

This change runs these suites using a custom test runner instead of simply
running the test file, which makes the individual test results, timings and
logs available to the test system.

Change-Id: Iae5f37d9bd1b3e9b26c66443fe10e5cca6a6b6bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118540
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-21 09:03:19 +00:00
Dmitry Stefantsov a61c775db8 [cfe] Rename "neither" nullability into "undetermined"
Change-Id: Iad242e4ae11147a4d49a7b19c78c09dcb2977188
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121981
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-17 14:39:30 +00:00
Johnni Winther 9f1b0fe102 [cfe] Handle explicit extension operator calls
Closes #38895

Change-Id: If8dd84dcd888dc1462f4598aacf0a2da141e2918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121855
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-17 09:39:14 +00:00
Paul Berry 1e3e9ee04c Flow analysis: introduce a debug implementation.
The debug implementation wraps the normal implementation, printing out
input, output, and state at each API call.

Change-Id: Id1641dd889029433877c68e964dcffa0e0d3e8c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121802
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-16 23:00:06 +00:00
Dmitry Stefantsov 23e8f2bcfa [cfe] Verify that Null is always nullable
Closes #38360.

Bug: http://dartbug.com/38360
Change-Id: I073a63bc968f1955a3c23bb8ed42e07b5955568a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120668
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-16 11:25:02 +00:00
Aske Simon Christensen e000482852 [cfe] Better marker length when pointing to a constructor
Change-Id: Ib962babb98e1fbc96231477eac70db0cb366d479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-10-16 09:47:03 +00:00
Paul Berry 69fa72dc17 Flow analysis: split interface and implementation, and add more doc comments.
No functional change.

Change-Id: I67fe2acdacdd68fa5841da087ff973885dc6325f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121772
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-15 20:51:08 +00:00
Paul Berry 61790a17b6 Flow analysis: add support for non-null assertion operator.
Change-Id: I7a60944a4389b6f7c8e182d5c9b402fcbb05b624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 4e9220efdb Flow analysis: change the way parenthesized expressions are handled.
Instead of forcing the client to provide a way to de-parenthesize an
expression, the client informs flow analysis when a parenthesized
expression is encountered.  This reduces the runtime overhead to zero
for non-parenthesized expressions, and it saves the front end from
having to worry about support for parenthesized expressions (since its
internal representation doesn't care about parentheses).

Change-Id: I0bb6e91c87acaa05591e1b075da18700b11e4aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Johnni Winther 42dcdf903c [cfe] Handle promoted type variables in getStaticType
Change-Id: I05a748ec800c7c18a52f8444ad030208ea14d268
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121325
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-11 19:04:48 +00:00
Vyacheslav Egorov 39e7da9ca4 [cfe] Fix ConstructorBuilder.prepareInitializers to refer to actual constructor.
Instead of referring to target constructor that is going to be patched.

Change-Id: Ic98146b69c9e5fbdcc13df86f3293f3d9d4462f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121328
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-11 18:44:18 +00:00
Kallen Tu ff8c704e9b Clean up handleVarianceModifier error handling and move to endTypeVariable.
Change-Id: I526e41511f57b48010d52dbcb7f7d7feb79600da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120932
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-11 18:39:28 +00:00
Jens Johansen d374ff8cbc [parser] Allow parser test to add trace to output for easier debugging
With this, once can for instance run
out/ReleaseX64/dart pkg/front_end/test/parser_test.dart -DupdateExpectations=true -Dtrace=true -- parser_test/nnbd/nullCheckOnIndex
and from the output see where stuff was called, e.g.

beginFormalParameters((, MemberKind.TopLevelMethod) (package:front_end/src/fasta/parser/parser.dart:1227:14)

and

       parseGetterOrFormalParameters(f, f, false, MemberKind.TopLevelMethod) (package:front_end/src/fasta/parser/parser.dart:2484:13)
         parseFormalParameters(f, MemberKind.TopLevelMethod) (package:front_end/src/fasta/parser/parser.dart:1153:15)
           parseFormalParametersRest((, MemberKind.TopLevelMethod) (package:front_end/src/fasta/parser/parser.dart:1216:12)
             listener: beginFormalParameters((, MemberKind.TopLevelMethod) (package:front_end/src/fasta/parser/parser.dart:1227:14)

This output should obviouslys not be committed, but is great for debugging.

Change-Id: I42db55ff928bde783d652b6338b54e6dba1550db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121326
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-11 14:05:16 +00:00
Jens Johansen 753c187675 [spell] Add 'reuslt' to blacklist
Change-Id: I405ed69d929710b5f2696d57e05511106f7b2bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121324
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-11 13:10:36 +00:00
Johnni Winther 377409f043 [cfe] Introduce FieldBuilder, FunctionBuilder, and ProcedureBuilder as interfaces
+ reduce ModifierBuilder interface
+ introduce ConstructorScope(Builder) and AmbiguousMemberBuilder
+ reduce use of Builder.target by using the more ligthweight MemberBuilder interface

Change-Id: I6366559f7c85bbd3224ef906505a67a379092686
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121063
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-11 10:15:24 +00:00
Jens Johansen b8aef62abd [kernel] Effectively clear extension members before adding new ones when loaing dill if 'shouldWriteData'
Prior to this change, loading a dill with extensions in it twice,
would mean getting the extension members twice.

Change-Id: I766a4a6b0ade98ce9af803db0c696e64821e015a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121064
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-11 07:33:03 +00:00
Jens Johansen 5c2b86897c [parser] late is a built-in identifier
Fixes #38803

Change-Id: I2fe7817aa0311c2370222a3205f1a1e02dc9aba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-11 06:19:13 +00:00
Paul Berry fd60a3eeba Flow analysis: generalize handling of ==.
This moves the logic for detecting the patterns `variable == null` and
`null == variable` into flow analysis, so that they don't need to be
replicated in each client.  It also opens the door to potential future
improvements (e.g. allowing `x == expr` to promote `x` to non-nullable
if expr has a non-nullable type).

Change-Id: I51fd9df822e3df1eb8bad5884f767c8b61c496ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120934
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-10 19:55:22 +00:00
Paul Berry 3dc60dac99 Flow analysis: use a stack of context objects rather than a stack of states.
This will allow us to store more varied context information (which
we'll need to do in order to generalize the handling of `==` in a
follow-up CL).

Change-Id: I85a19004dd4d4845d6fce7d8c0ce3cf0bbec8120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120933
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-10 19:55:22 +00:00
Johnni Winther 0ee78fac98 [cfe] Rename declaration.dart and procedure_builder.dart
to builder.dart and function_builder.dart to reflect their primary content.

Change-Id: Ib0f9c2970b6a88e4381b0cd7532e4410b72c2a2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120791
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-10 08:11:27 +00:00
Paul Berry 89301c3732 Flow analysis: fix tests to pass the correct value to ifStatement_end.
The tests were passing by luck.

Change-Id: I1b44c6d675b59c84e6a6bd70741462d6f29c51e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 18:24:08 +00:00
Paul Berry 88b76997c4 Flow analysis: rework handling of closures.
Rather than suppress all promotions for variables written to in
closures, we track whether a closure might exist that captures a write
to a variable, and only suppress promotions once such a closure
exists.  This is consistent with what is proposed in
https://github.com/dart-lang/language/pull/473.

Contains a repro of #38791.

Change-Id: I4683581908703b510a3231b8fa8ed697121b09da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 18:24:08 +00:00
Paul Berry 144b8eda81 Flow analysis: track variables captured in closures more accurately.
Previously, we considered a variable to be captured by a closure if a
write to that variable occurred anywhere inside a local function.  But
that was overly broad; it meant that we incorrectly classified all
written-to local variables of a local function to be captured.

This CL makes the AssignedVariables logic aware of variable
declaration sites, so that it only considers a variable to be captured
if it is written to at a lower level of local function nesting than
its declaration.  As a side bonus, it means that it can now exclude
out-of-scope variables from all sets of closed-upon and written-to
variables, which should make flow analysis faster by preventing it
from spending a lot of time accounting for variables that aren't
visible.

It also adds tracking of the set of all variables written to and
captured within each top level function.

This partially reverts commit 55466fd3cc.

Change-Id: Ibcd6476445addebed13cfc5ecc470d644e519148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-09 17:34:51 +00:00
Jens Johansen f09edd1d32 [CFE] Add incremental serializer
Add an incremental serializer that can be used to avoid re-serializing
the same thing again and again.
It does this by grouping libraries into Components / bundles,
serializing them individually and using the concatenated dill feature to
output the wanted data --- just potentially faster if we had the data
in cache.

Note that the serialized output might contain *more* than the input given
if we cached the wanted data into a bigger bundle.
The output will always be "closed" though, i.e. if the stuff that is
included that is too much added a new dependency, that dependency will be
included as well.
This should generally make it safe, although one can imagine situations
where it could pull in lots of dependencies that it wouldn't otherwise
have.

It is being driven by the incremental compiler which makes sure to
invalidate the cache when the data changes.

Except for situations where the libraries are changed externally after
being serialized, but before being serialized again, where one then wants
the updated library serialized, the feature should be safe.

Change-Id: I2a504abe6dbb68434c3b04abff13480ef72a6a6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120786
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 13:28:12 +00:00
Jens Johansen 6ebf3f0889 [kernel] Clear a few lists when loading dill
Prior to this change, loading the sdk dill twice for instance would
result in additional exports as well as parameter counts doubling,
essentially destroying the result.

Change-Id: I4d694bec1926d6df6572e9bb36e8a88ec0822e27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120785
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-09 10:34:07 +00:00
Jens Johansen e7a128ecc2 [CFE] Refactor incremental compiler test(s)
Change-Id: I538d5bb5f50af2409d0c99e8ab15b803b9e10fc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120783
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 10:10:32 +00:00
Johnni Winther 46a9273664 [cfe] Opt in to NNBD using experimental flag _and_ version number
+ add testing of nnbd types and opt-out in static_types_test

Closes #38287

Change-Id: I019753a74cdc6980dadb0608f7ac486c127af6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120666
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-09 08:43:03 +00:00
Kallen Tu e3ca5ee6ba Check variance of type-parameter use in supertypes.
Tests have both correct and erroneous implementations
of variance.

Change-Id: I49dd76f42399015dd6e3f9688e598c271ce7ab1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119722
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-08 21:33:40 +00:00
Johnni Winther 431509ba8e [cfe] Remove builder/builder.dart
Change-Id: I471e2c9a0875c4ff14169a935758f53a74655f25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-08 20:24:38 +00:00
Johnni Winther a85054d12e [cfe] Handle parser recovery in extension declarations
Closes #38600
Closes #38712

Change-Id: I875c55c49253066263bfe1c9cbe97debd1e81648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120583
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-08 20:24:38 +00:00
Paul Berry 1325e0ff96 Flow analysis: create flow analysis on entry to top level declarations.
Previously we created flow analysis on entry to a function/method's
block, but that meant that we would miss promotions that occurred
inside constructor initializers.

Contains test cases for #38761

Change-Id: I566fb77173d9ce6b3aae994c525955f3cbe06fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120503
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-08 16:14:21 +00:00