However, the test still fails, but that's because of an inconsistency
which we can revisit later. The comment describes it best.
This is the stack trace of the failure:
AnalysisException: Element mismatch in /test.dart at class B
Caused by Bad state: Expected an element matching ``, got `x`
\#0 DeclarationResolver._match (package:analyzer/src/generated/declaration_resolver.dart:585:7)
\#1 DeclarationResolver.visitVariableDeclaration (package:analyzer/src/generated/declaration_resolver.dart:520:31)
\#2 VariableDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:11058:49)
\#3 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7987:20)
\#4 DeclarationResolver.visitVariableDeclarationList (package:analyzer/src/generated/declaration_resolver.dart:543:22)
\#5 VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:11154:15)
\#6 FieldDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4372:17)
\#7 RecursiveAstVisitor.visitFieldDeclaration (package:analyzer/dart/ast/visitor.dart:827:10)
\#8 DeclarationResolver.visitFieldDeclaration (package:analyzer/src/generated/declaration_resolver.dart:226:32)
\#9 FieldDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:4367:49)
\#10 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7987:20)
Bug:
Change-Id: Ia0d8536e2f259c9e9c0b46366794e07796750467
Reviewed-on: https://dart-review.googlesource.com/26465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Fixes#21938 (Front end does not warn on function calls on Object).
A small number of tests begin failing with this change--these tests
have been marked with issue #31533 for later triage.
Change-Id: I3a956410a6780772fe90098d8604fb10718504df
Reviewed-on: https://dart-review.googlesource.com/26045
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Occurs when there are both bounds and also partially provided type
args. Attempt to still perform substitution analysis even during
partial application, so long as the partial application warning is
still provided.
Bug: 30147
Change-Id: I25a6dabe458494ee9fd6c53aeba75883c3143816
Reviewed-on: https://dart-review.googlesource.com/26040
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL deprecates the front-end API and moves it into src/api_prototype.
For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)
Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
At this point KernelDriver is used only by Analyzer, so I don't include
anyone from the FrontEnd team. We will merge to get the same performance
benefits of the latest IKG approach, but later.
Only just enought integration is done - we can store and apply
types in the local variable declaration.
Everything is in disarray, I will follow up with improvements.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ie3434e26233b84fb019c50a7cc834a08d0dadbed
Reviewed-on: https://dart-review.googlesource.com/22202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Previously, a ShadowSyntheticExpression was its own kind of Expression
unrelated to any of the Expression types defined in the kernel. It
responded to visit requests by forwarding the visit request to the
desugared expression. This had the advantage that for serialization
purposes, ShadowSyntheticExpressions would automatically disappear.
But it had the disadvantage that if a ShadowSyntheticExpression ever
needed to be replaced with another node (e.g. because an implicit
downcast was needed), the _ChildReplacer would get confused by the
visitor forwarding and fail to replace the node properly.
This CL fixes the problem by changing ShadowSyntheticExpression to a
Let node of the form `let _ = null in desugaredExpression`. Since
this is a genuine kernel expression, it no longer needs special
visiting semantics, and node replacement works properly.
In most circumstances, we replace the ShadowSyntheticExpression with
its desugared equivalent during type inference, so the final
serialized kernel representation is unchanged. However, in a few rare
circumstances involving error recovery, a ShadowSyntheticExpression
remains in the tree. Semantically this shouldn't be a problem, since
the behavior of `let _ = null in x` is the same as the behavior of
`x`. Nonetheless, I hope to get rid of these rare circumstances in
follow up CLs.
Change-Id: Iacf8c0028c424ac9ef98ef8302680e289bf7a017
Reviewed-on: https://dart-review.googlesource.com/21571
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This updates the base analyzer parser tests so that they can be run
when the fasta parser is enabled using -DuseFastaParser=true
Change-Id: I24904e453b62091a7b1960fa064e7a7653ca3fee
Reviewed-on: https://dart-review.googlesource.com/20620
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Only fails under the new analysis driver. Flipped all
resolver_test_cases to run under the new analysis mode by default since
that's the default case these days.
Aside from that, the change is pretty small/simple/safe: just had to
resolve type declarations in FieldFormalParameters in two places to
handle both named and non-named forms.
Bug: 31107
Change-Id: I45352f921085e32b53bda1ebcf74a0d51b82e67a
Reviewed-on: https://dart-review.googlesource.com/20561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
* add parsePrimaryExpression and update tests to use it
* rework formatParameterList tests to use new API
* update expression tests to use new parser adapter API
* rework parseConstructorInitializer to use new proxy API
* move parseTypeParameter and parseTypeParameterList
Change-Id: I58b45999ae9e194d0b7728b7e82cb2b55f2281c3
Reviewed-on: https://dart-review.googlesource.com/19820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
For now only getKernel() uses the new compilation method.
There are several new failing tests because redirection factories
are not serialized/deserialized correctly yet (but I saw kernel
support comming for it), and outlines don't include private fields (
which we want to work around by storing just names).
R=paulberry@google.com, sigmund@google.com
Bug:
Change-Id: I0d964862066ac0ee9e7b5c7b1d3802171a874aef
Reviewed-on: https://dart-review.googlesource.com/19440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>