Some of the "regressions" in CL 94993
(73be247e12) just turned out to be test
expectations that needed to be updated. This CL makes the following
kinds of updates to test expectations:
- Adds info:INFERRED_TYPE_LITERAL when necessary (some of the code for
inferring the types of type literals has been generalized, so this
info is reported more frequently than it previously was).
- Removes duplicate error:*_TYPE_NOT_ASSIGNABLE (it was previously a
bug to report this twice; that bug is now fixed).
Change-Id: I75a6ab3c420c2aa868ec8cb203e33f76a1e57a75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96201
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>
Also some very basic top-level inference: field formal initializers in
constructors, initializers of top-level variables (for now ignoring
dependencies), setter return type to `void`.
We pass 172 or 590 resynthesis tests, about 29%.
Change-Id: Id70b80ceb7c794627626a1fe94172b0e9ccdda8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95672
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This causes the implementation to match the spec. Also, it's an
important distinction because the analyzer allows the user to change
the meaning of assignability checks using the analysis option
"implicit_casts: false". We don't want this option to change the
meaning of set/map disambiguation.
Change-Id: I2a870209a31b4344c0568ecfe741bf731d9489a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is one step in refactoring non-nullable enablement
* update AstBuilder to record isNonNullable in CompilationUnitImpl
* update ErrorVerifier to pull non-nullable from CompilationUnitImpl
Change-Id: I78e5f529330f10f294ad1c1b3b7ac8b672a5ee9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95426
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- ForStatement and ForEachStatement will be replaced by ForStatement2.
- MapLiteral and SetLiteral will be replaced by SetOrMapLiteral.
To ease the transition, the old classes are subtypes of the new
classes, so even though the analyzer still creates instances of the
old classes, clients should be able to start referring to the new
classes in their code. The analyzer will stop creating instances of
MapLiteral and SetLiteral when the experimental flags for the "UI as
code" feature are turned on, and will stop creating instances of all 4
classes when we bump the major version number (which should happen
sometime in March).
For visitors, we've updated the base classes with the following default methods:
visitForStatement(node) => visitForStatement2(node);
visitForEachStatement(node) => visitForStatement2(node);
visitMapLiteral(node) => visitSetOrMapLiteral(node);
visitSetLiteral(node) => visitSetOrMapLiteral(node);
So clients should be able to start revising their visitors to override
the new visit methods rather than the old ones, and the visit methods
in the base classes will automatically forward to the new visit
methods.
Change-Id: Ifde3a2aa3c8c49ce4e65dfaabf086db4dabb73f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95665
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
ba5644b76c fixed an analyzer bug causing
a crash when a top level variable requiring type inference contained a
closure involving type promotion, and removed some explicit types that
were present in the analyzer to work around the bug.
Although the bug has been fixed now, the fix hasn't rolled out in a
release of the SDK. So to avoid people seeing analysis server crashes
when editing the analyzer, I'm re-introducing the workaround.
Change-Id: I5e61345021cd33cb9ad1f017a7619815a38c6a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95667
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
CommentReference is not done yet.
Also skipped deprecated:
visitListLiteral2
visitMapLiteral2
visitSetLiteral2
And about to be deprecated?
visitForEachStatement
visitForStatement
visitMapLiteral
visitSetLiteral
Now we can resolve, write and read back into AST everything in pkg/.
Some statistics:
R=brianwilkerson@google.com, paulberry@google.com
totalContent: 34814665 characters
totalWriteTime: 18140 ms
totalWriteBytes: 305675628
totalReadTime: 2761 ms
Change-Id: I2f92bb47c124d5ba040d8f66f762d23603c17609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Promotion analysis requires the localVariableInfo data structures to
be set; these are set by the VariableResolverVisitor. So we need to
ensure that this visitor runs prior to type inference.
Change-Id: I579301beb101f32a1965f9eb8f07b1196d232b8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
ForStatement and ForEachStatement will be removed in favor of
ForStatement2. MapLiteral and SetLiteral will be removed in favor of
SetOrMapLiteral. This CL changes FindNode methods to match, and
adjusts callers.
Change-Id: I89990f63aa277acd31458d485e897ebf0c6cf61f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>