This CL moves the bounds checking into the TypeBuilder instead of
performing it from the outside on the computed DartType node.
This solves several problems:
1) Errors are now reported on the type in the code instead of the
declaration which holds the type.
2) Checking of type aliases (both function and nonfunction type
aliases) is now handled correctly in all cases. This achieved by
computed the aliased type (containing TypedefType nodes)
internally and performing the checking on this type, and only
convert the type into the unaliased version (without TypedefType
nodes) after checks have been performed. Previously this handled
through the FunctionType.typedefType property for function type
aliases and through and incomplete work-around for nonfunction
type aliases.
3) With 2) FunctionType.typedefType is no longer needed and is
removed.
TEST=general/bounds_*
Change-Id: I7653bca5ccb0ebf4b3553828a298d1ad918ef235
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This CL changes the test
language/generic_methods/explicit_instantiated_tearoff_test.dart
such that it no longer expects a generic instantiation of a local
function tearoff to be notEqual to another function object which is
the same local function, same enclosing invocation, same type
arguments.
The rationale is that we should not preclude an optimization whereby
these function objects are canonicalized (at run time, or if they
can be lifted to the top level even possibly at compile time).
Change-Id: I5845a19ce9ccf931c4d3abe4ab619f3ed2a2fbc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209860
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Extension method closurizations are specified to be unequal unless they
are identical (because the extension itself may have different type
arguments, so it's not enough that it is "the same method").
This CL changes the test
language/generic_methods/explicit_instantiated_tearoff_test.dart
such that its expectations match that property.
Change-Id: Ife31646623099ad5d1b970d0097d37d6b00c5814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208645
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Change-Id: I2e76322f57a331704a657b7cc471a61fd3227c94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197168
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
In these tests I've tried to test a lot of the corner cases
surrounding the addition of a `<type arguments>` selector to the
grammar (which we intend to do as part of constructor tearoffs), to
make sure that when we do so, we don't break any existing
functionality.
Change-Id: I765195cdd3745904f4aeb36663f59afe03381ab8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200001
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Clean up signatures of runtime functions in object.{cc,h} using the trail to avoid cycles. Move the trail to the last parameter of these functions.
Introduce a trail in IsSubtypeOf() to avoid cycles introduced by bounds of F-bounded types. Issue uncovered by the new normalization tests.
Change-Id: I3241c7e4023a09c122e1594b7aff90b5b103f4f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150180
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I3ec18bb7e7cfb087a58d744d357bf004c0438ba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147813
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>