And updade flow analysis clients to use this interface, so that we
have no risk of accidentally trying to promote things that shouldn't
be promotable. (Previously we used VariableElement, which would have
allowed fields).
Fixes https://github.com/dart-lang/sdk/issues/38572.
Change-Id: I225d3adabea503ca7eb9042516cf95d5a257fec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
TypeParameterElement caches its default type, as it gets it from the
resolved TypeParameter node. So, while DefaultTypesBuilder will get
to the node from which we got this default type, and will finish its
building from TypeBuilder to a normal DartType, it is too late. We
should make sure that we only cache already built types.
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/38498
Change-Id: Ie3e3645efdf44a9e599655bec5a5e410c75c1a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119166
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The constant evaluator does not know if the expression it is evaluating
is actually in const context. If not, those messages are misleading.
Fixes https://github.com/dart-lang/sdk/issues/38568
Change-Id: Iddfb1fbdc12eb1874a1f400cf08763e003db23e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118982
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Also fix the ELF loader to allow segment alignment >page size.
Change-Id: Icc4c2eaae44171e74cc41d9f2b06701acad86a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118983
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This fix is basically a revert of the first fix for for the same issue,
627e4c8cadFix#37708
Bug: 37708
Change-Id: Ic470b2663e7171fcac6a8de3d9e1276b7815a64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118574
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
flutter/examples/flutter_gallery$ flutter test --local-engine host_debug -v | grep took
First run -> Second run (initialize from dill file)
AST 11539ms -> 6837ms
Bytecode before 32790ms -> 26665ms
Bytecode after 15435ms -> 11111ms
Change-Id: If1088f86a583170c9f3690778a5b8e2fd4b48ace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118341
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I0844d5d9e61351bae64ed2b0747d86872c336339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117922
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Now that the migration tool inserts `required` rather than `@required`
for required parameters, we need the trial_migration tool to
understand the new behavior.
Change-Id: I401310930120cf6e57af7ab633983b44415d404f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Pass variance data to field in TypeParameter through the listeners.
ast_to_text will print variances for classes and mixins if specified.
Avoids serialization/deserialization (impl in future CL).
Change-Id: I298537604823710f0d30001f4cb5f1e81530959f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118464
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Details provide a way for clients to provide navigation support. I'm
imagining that the description could be used as link text.
The deatils are currently more of a data dump than information. I need
to see more migration results in order to figure out when and how to
pare down the data into actionable information.
We might want to capture all of the navigation targets as we build the
info so that we can create anchors in the HTML.
Change-Id: Ie48622ce7d935d3c028ea42e51cfc8da590db149
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118908
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
analyzer_plugin has max constraint to analyzer version 0.38.0 while the latest version is 0.38.3 and it causes a lot of issues for libraries that use it (built_value for instance)
Closes#38558https://github.com/dart-lang/sdk/pull/38558
GitOrigin-RevId: 83fb8a811cae2845aec5e66a2f53259e7b347eb2
Change-Id: I68a7f4e8108d06565e9ef9d2d0411c97d4f09993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
+ avoid implicit extension for [] or []= when the other is defined on
the receiver.
Change-Id: I99c76a66bfb4f72c396097b2f347aad9f0a42f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118940
Reviewed-by: Jens Johansen <jensj@google.com>
Global variable globalDebuggingNames in the front-end can accumulate a
lot of garbage (all ASTs) if toString() is called from an AST node.
Bytecode generator uses Expression.getStaticType a lot, which calls
Expression.getStaticTypeAsInstanceOf, which sometimes calls toString()
when it throws an error (these crashes are tracked in
https://github.com/dart-lang/sdk/issues/34496 and bytecode generator
has a workaround to catch them).
As a result, after bytecode generation all ASTs were hanging out of
globalDebuggingNames, which leaks a lot of memory.
Fixes https://github.com/dart-lang/sdk/issues/38553
Change-Id: Ic1516d5ec9bf60861ae678e150c66d2e9394e2cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118914
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Change-Id: I39cdef152e58666f90970097826cd089ca37c5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118903
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>