The parser now generates a ConstructorWithTypeArguments error and a new
handleInvalidTypeArguments event after a begin/endTypeArguments event pair
when those type arguments are in a syntatically invalid location.
For example: `new C.n<int>();` in
```
class C<T> { T f; C.n() {} }
main() { var x = new C.n<int>(); }
Most listeners handle this event by dropping the invalid type arguments,
but AstBuilder now preserves those invalid type arguments in the AST
to support better code quick-fixes/quick-assists/refactoring.
Change-Id: I5b22bd4903cd9ee3645936b9a108598b603cf9ca
Reviewed-on: https://dart-review.googlesource.com/c/79300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Also, remove it from ErrorVerifier.
R=brianwilkerson@google.com
Change-Id: I35f6f7fd2f8c6680ec470e7bf7da4780a3c69df3
Reviewed-on: https://dart-review.googlesource.com/c/79360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Its only use was in formatting an internal error message that
generally only fires in unit tests if we have significant bugs in
summary logic. Eliminating it doesn't really make the error any more
difficult to debug, since it is easy enough to stop the unit test in
the debugger and examine the data structures manually.
Addresses code review comment
https://dart-review.googlesource.com/c/sdk/+/79145/1/pkg/analyzer/lib/src/dart/element/element.dart#7737
Change-Id: I17f18e1e4abfac4c5dd9067706fabc9bc4de7cff
Reviewed-on: https://dart-review.googlesource.com/c/79282
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
It didn't work properly anyhow (see issue #34657). Changed the call
sites to use GenericTypeAliasElementImpl.instantiate, which does have
the correct behavior.
Change-Id: I4b9c6cc8ddfcf3b0bebe40b7d874c4630c4b5ae4
Reviewed-on: https://dart-review.googlesource.com/c/79283
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The methods addBundle and createPackageBundle were previously in the
derived class SummaryLinkerTestStrategy, but there's no reason they
have to be there; they don't rely on any functionality that's specific
to linker tests. Moving them will allow additional summary tests to
make use of package bundles.
Change-Id: I988147c76e6dcfef5ef0f000d66b1639b4b3ecf7
Reviewed-on: https://dart-review.googlesource.com/c/79280
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is necessary to ensure that type parameters that refer to the
enclosing context get serialized correctly.
Change-Id: I1e95cc4e83be76bf003faa037eff80728c1fb748
Reviewed-on: https://dart-review.googlesource.com/c/79145
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This experiment didn't work out--it turns out that too many clients
were relying on the performance characteristics of unlinked summaries.
Change-Id: I3e7c54c18b5b02ee0df17ef5d62e1f6a7e35da68
Reviewed-on: https://dart-review.googlesource.com/c/79144
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I9fd0b2031ceb7c7831a7131c11c3848dbf3f336e
Reviewed-on: https://dart-review.googlesource.com/c/79143
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
But still keep it using the old InheritanceManager.
R=brianwilkerson@google.com
Change-Id: I58f9187a97fc161215614ed55d6e08007f31595c
Reviewed-on: https://dart-review.googlesource.com/c/79080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also remove any calls that aren't required. The function still works if you pass it a relative path (for convenience, if you have a variable) but it's not required for relative paths.
Change-Id: I567e098f5956a7c2b5fe2d6d7d7fb16a263a72cc
Reviewed-on: https://dart-review.googlesource.com/c/79025
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
This will allow us to create a synthetic
GenericFunctionTypeElementForLink representing the function type
defined by an old-style typedef. That in turn will be necessary to
fix some incompatibilities between the summary linker and element
model representations of typedefs.
Change-Id: Ia3622d58cac25976022bf79a0ac47b190f1f411c
Reviewed-on: https://dart-review.googlesource.com/c/78920
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We now determine whether a type is simply bounded in the summary
linker, so that we can take advantage of the linker's circularity
detection logic.
Fixes#34635.
Fixes#34636.
Change-Id: I6c5040dbaeb79957d8a84e3f76e6a51834b57f05
Reviewed-on: https://dart-review.googlesource.com/c/78867
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This prevents tests marked as failing in InferredTypeTest from being
inherited by InferredTypeTest_Driver.
Change-Id: I4a364cd951dbf2bdf73e0bdda4b5f2630c91ea55
Reviewed-on: https://dart-review.googlesource.com/c/78863
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- Wrap all paths with separators in convertPath() for Windows
- Ensure convertPathForImport does the right thing for relative paths
- Use the correct convertPath for imports/exports/parts
Change-Id: Ie95e41686479f175c9ba661180fdf5ad90b409e8
Reviewed-on: https://dart-review.googlesource.com/c/78740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
The tests are moved into a mixin,
StrongModeStaticTypeAnalyzer2TestCases, which both
StrongModeStaticTypeAnalyzer2Test and
StrongModeStaticTypeAnalyzer2Test_Driver apply separately. This
allows tests to be marked as failing in
StrongModeStaticTypeAnalyzer2Test without affecting
StrongModeStaticTypeAnalyzer2Test_Driver.
Change-Id: Iabd641d5ecf03fd0481baf053e689d68a0e0e7a1
Reviewed-on: https://dart-review.googlesource.com/c/78705
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: If16a8ea5da0f2cd805d3360e1d70cd19be8066a8
Reviewed-on: https://dart-review.googlesource.com/c/78621
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
...when we are using Analysis Driver.
This method causes switching to the task-model based way of computing
constants. And so filling SdkAnalysisContext with data. And because
SDK instances are long-lived, we were keeping this data as well.
R=brianwilkerson@google.com
Change-Id: Ie6f4a4ce8a05238b9640aef961af394d64373573
Reviewed-on: https://dart-review.googlesource.com/c/78420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
It might have caused a memory leak.
It is hard to say - there ware some references from Closure, from
other Closure, and eventually from the _completer.
R=brianwilkerson@google.com
Change-Id: I18c75f48e74e9ae04265170751224261f51ccf76
Reviewed-on: https://dart-review.googlesource.com/c/78322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Fix#33599 stack overflow for recursive function type parameters
Bug: 33599
Change-Id: I31a14e9f941bfd6bb7c2dba09f671d887e535b2a
Reviewed-on: https://dart-review.googlesource.com/c/76040
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
This updates the fasta parser to use the "incorrect" keyword
when "extend" or "on" is used instead of "extends" in a class declaration and
when "extend" or "extends" is used instead of "on" in a mixin declaration.
Change-Id: I6bef3f897e24c3c0100180d2bf9f4d2ec7608eef
Reviewed-on: https://dart-review.googlesource.com/c/78101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This CL moves missing parameter recovery code out of the AstBuilder into
the parser, and adds guard code in the AstBuilder to assert that param is not null.
Change-Id: I8e68194ad3de4b8a4be755f8fa2943344393267a
Reviewed-on: https://dart-review.googlesource.com/c/78000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: I1fc41cc0b2e2848565a5411d0512a4ca086ab659
Reviewed-on: https://dart-review.googlesource.com/c/77761
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: I89a60ae9ab639c7907a92976e1eb8007d0f4ee9b
Reviewed-on: https://dart-review.googlesource.com/c/77760
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Change-Id: Ic458da90e5bdb6b3b7fee26088b17dd560ff3a68
Reviewed-on: https://dart-review.googlesource.com/c/77861
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I224894b47a03c8b5cf48ddd3a125ba09a9a47a23
Reviewed-on: https://dart-review.googlesource.com/c/77842
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>