If the source kind isn't updated, we get a bogus error:
The imported library ... must not have a part-of directive.
This error is calculated in BuildDirectiveElementsTask.
based on SOURCE_KIND.
SOURCE_KIND is based on whether MODIFICATION_DATE is -1,
so make sure we invalidate MODIFICATION_DATE.
Also, fix an issue where _sourceChanged would have
no effect if incremental resolution isn't run, because
the content has already been updated and is therefore
equal.
Also, remove unused RelativeFileUriResolver and
clarify comments around missing Source handling.
BUG=https://github.com/dart-lang/sdk/issues/25808R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1737693004 .
In strong mode, this is set on all classes. So there is no need to add
any data to the summary format.
Also found and fixed a bug causing a few resynthesis tests to fail to
set the "strongMode" option properly.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1737903005 .
This file can be consumed by standard flatbuffer tools, allowing
summaries to be consumed from other languages. For example, a summary
file can now be converted to JSON using:
flatc -o $outputDirectory -t \
pkg/analyzer/lib/src/summary/format.fbs -- $inputFile
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1743713002 .
When a function type arises out of a LUB (least upper bound)
computation, it pionts to a synthetic FunctionElement that is not
connected to the element model, so we can't summarize it by simply
storing a reference to the FunctionElement. We have to store the
FunctionElement's return type and type parameters.
This required reworking _CompilationUnitSerializer's mechanism for
tracking whether it is creating linked or unlinked references;
previously it kept track by passing a boolean around. Now it uses a
bool field, which should be much less error prone.
Fixes generation of strong mode SDK summary (previously it failed with
an assertion error when in checked mode).
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1740923002 .
This is to ensure that error.source matches the source of
the ChangeNotice it appears in and the analysis server will
report the error together with other errors for the same file.
(Moving the error seems easier than figuring out how to put it
on a different Source, and it might be that the import/export
is at fault anyway.)
BUG=https://github.com/dart-lang/sdk/issues/25826R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1739553003 .
I think the fix does the change needed to configure SDK for using
the strong mode summary, but I was not able to verify this fully
because of the exception with LibraryElementHandle.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1734773003 .
* Defines `isProtected` accessors.
* Adds a simple mechanism to our test `AnalysisContextFactory` allowing us to contribute package resolution to test cases.
* Adds `meta` awareness to `ResolverTest`.
NB: this *only* adds method invocation support. I'll generalize to all members in a follow-up. There's enough here though that I wanted to get some early feedback.
BUG=
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1723243002 .
* we now push the context return type down when inferring
* we also take this into account in our initial downards inference for arguments
* adds a common AST interface for FunctionExpressionInvocation and MethodInvocation, so we can handle these more uniformly
R=brianwilkerson@google.com, leafp@google.com
Review URL: https://codereview.chromium.org/1720433002 .
From 17.6.1: "It is a static warning if the static type of c may not be
assigned to bool."
Strong mode catches this case, but it looks like ErrorVerifier just
missed it. Since I'm working on making strong mode lean on ErrorVerifier
for finding sideways casts like this, the discrepancy popped up.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1720083002 .
Previous to this CL, all prefixes were dropped during resynthesis,
causing constant ASTs like `x.length` to get resynthesized as simply
`length`, which did not retain enough information for constant
evaluation.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1718013002 .