The feature is disabled by default; enable it by setting the option
"enableSuperMixins". (This name was chosen to match the
"--supermixin" flag accepted by the VM).
The feature is not yet exposed through analysis server or the
analyzer_cli.
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1262163002 .
Previously, trying to access a static member of a class using '?.' was
not allowed. But the spec was changed in
b11670f899 so that
'ClassName?.staticMember' is now equivalent to
'ClassName.staticMember'.
This CL updates analyzer to follow the spec, and updates the tests in
"tests/language" accordingly. VM and dart2js still need fixing
(see #23794 and #23795).
Fixes#23464.
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1255293005 .
Previously, the classes ScopedVisitor, ResolverVisitor,
TypeResolverVisitor, and VariableResolverVisitor each had 4
independently maintained constructors, used respectively by
LibraryResolver (and DDC), the task model, the incremental resolver,
and LibraryResolver2. This was difficult to maintain, and it was
about to get worse with the introduction of diet resolution.
This CL merges the constructors into one, using named optional
parameters where possible to reduce the burden on callers.
A few of the old constructors are kept on a temporary basis because
they are used by DDC, but they are deprecated; these can be removed
once DDC resolution is fully integrated with analyzer.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1207383005.
Previously we computed them during resolution, but this created a
problem: since the set of constructors for a mixin application depends
on the constructors in the superclass, and the superclass might itself
be a mixin application, it might theoretically be necessary to analyze
all files in the transitive import/export closure before it is
possible to compute the set of constructors for a class. As a result,
in order to produce completion results after a non-incremental change
to file X, we have to re-analyze the entire transitive closure of
files importing or exporting X. This takes prohibitively long.
This change moves the computation into the ClassElement.constructors
getter. The computation is not cached, so now a change to file X only
requires rebuilding the element models for files directly importing X
(or directly importing files that contain X in their transitive export
closure).
Since the result of the computation is not cached, this will produce
an increase in analysis time, however since mixin applications are
used so rarely, the performance impact should be negligible.
Fixes#23732.
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1215053003.
As of commit 67b99e4b33, it is now
consistently a compile error for a prefix not to be followed by '.'.
(Previously, there were two exceptions in which a prefix not followed
by '.' was treated as though it was preceded by "this.")
This CL updates analyzer to be consistent with the new spec langauge,
and modifies the tests in tests/language accordingly.
Dart2js and the VM do not yet produce the correct compile-time error
in all circumstances. See issues #23611 and #23612.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1186033004.
Previously, the least upper bound code was only half-written--it
computed correct results if both types were interface types, and
otherwise returned null. Now we always return a non-null type.
Unfortunately, the full least upper bound algorithm in the spec
requires referencing types not reachable from the types being
compared; thus in order to execute it we need access to the
TypeProvider. We can't do this with the existing API. So that API
has been deprecated. The new API uses a class TypeSystem which
contains a pointer to the TypeProvider. This new class should also be
a useful starting point in case we need to make the type system more
pluggable in the future.
Clients that use the old API will see no change in behavior--they will
still get the half-written algorithm.
Still to be addressed in future CL's:
- Deprecate getSmartLeastUpperBound.
- Fix calls to getLeastUpperBound and getSmartLeastUpperBound in analysis
server.
- Implement least upper bound computation for function types.
- Make sure type parameters function correctly in the presence of F-bounded
polymorphism.
- Implement shared tests.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1179343004.
Add RESOLVED_UNIT_NO_CONSTANTS as a public result.
Document results that are computed with the task model.
We need this to be able to use onResultComputed() in Analysis Server and
know that we will get enough information.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1181603004.