This improves how generic function types are modeled. In particular, we can now handle types like <T>T -> T, in printing, equality, and the type parameter is correctly removed when it is instantiated.
This preserves the existing lazy "substitute" operation, and makes the "instantiate" operation interact with it correctly. Given a type like:
{T/T}<S>T -> S
we can substitute S/T to get:
{S/T}<S>T -> S
then if we instantiate as <int> we'll get the correct:
{S/T, int/S}T -> S, which == S -> int
This also converts typedefs over to the new system, as this seemed like the most natural thing. (However this does *not* change how the type name is evaluated, in particular given the type name "F", where "F" is a typedef `<T>T -> T`, will result in the function type `{dynamic/T}T->T` exactly as it did before. If we want to write the type `<T>T->T` we will need a different mechanism.)
R=brianwilkerson@google.com, leafp@google.com
Review URL: https://codereview.chromium.org/1488383004 .
The profile signal handler may interrupt when the current Thread
is in an inconsistent state.
Members of the Thread that is unscheduled are NULLed out before
OSThread::SetCurrent sets a new current Thread. Fix this by resetting
the current Thread's fields after a new Thread is set as current.
BUG=#25702
R=iposva@google.com
Review URL: https://codereview.chromium.org/1491283002 .
Propagating type/cid at conditional branches is not possible because
it may cause invalid code motion.
For this to be safe we need to explicitly represent the dependency
between checks eliminated in a branch and the condition that constrains the type/cid.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/1491373005 .
This ensures the implicit closure function is enumerated in later steps. Fixes crash in co19 test reducible as
import 'dart:math';
main() {
print(const [1, 2.0, "3"].fold(0, max));
}
Also enumerate invocation dispatchers to avoid a similar situation there, though I cannot find a crashing example involving them.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/1489203004 .
We get extra precision from including argument types that produce errors.
e.g. {int} + {int,null} --> {int}.
Nice improvement on some numerical benchmarks where the result is used as an index where we can now use the builtin indexer.
Review URL: https://codereview.chromium.org/1493673003 .
For some reason html.Element's static const _tagsForWhichCreateContextualFragmentIsNotSupported is inferred to dynamic instead of a ContainerTypeMask.
This change will also 'do the right thing' if we turn off type inference.
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1490923003 .
The test suite PoorMansIncrementalResolutionTest was turning on the
new task model during setup and turning it off during teardown; as a
result, any tests run after it were using the old task model.
The easy fix is to just stop trying to adjust the task model state in
this test suite, since the new task model is on by default now.
This should fix test breakages when run via pkg/analyzer/test_all.dart.
TBR=scheglov@google.com
Review URL: https://codereview.chromium.org/1497573002 .
This should help to fix the following exception:
Dart analysis server, SDK version 1.13.0-dev.7.12, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
Bad state: No element
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1492843003 .
- renames the existing AbstractValue in cps_ir/type_propagation.dart to AbstractConstant
- introduces AbstractValue as an empty superinterface of TypeMask, and
- lift the interface of TypeMaskSystem to the superinterface AbstractValueDomain.
In follow-ups:
- change simple uses from TypeMask(System) to AbstractValue(Domain)
- update names and comment in AbstractValueDomain to more precisely reflect the abstraction
- update the complex uses (mainly type_propagation.dart) to use AbstractValue(Domain)
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1415883005.
This fixes the following reported exception.
Dart analysis server, SDK version 1.13.0, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
The null object does not have a getter 'offset'.
NoSuchMethodError: method not found: 'offset'
Receiver: null
Arguments: []
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1487683006 .
I was not able to reproduce the problem.
But this might fix the following exception.
Dart analysis server, SDK version 1.13.0, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
type 'MethodInvocation' is not a subtype of type 'ConstructorDeclaration' in type cast.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1489823003 .