The motivation for this change is that we can't compute the nullability
for such type parameter types anyways. Additionally, it stops the
cascading error in case the type variable is its own bound indirectly,
via a chain of other type variables.
Change-Id: I940f19bb47952108ac1e0d1a0ef197b373b6b8e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114946
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Output from a comparison could be something like
Integers differ: 2 vs 3
Map with key 'nullability' has different values (tag 95, likely 'TypeParameterType')
Lists have different values at index 0
Map with key 'items' has different values
Map with key 'typeArguments' has different values (tag 93, likely 'InterfaceType')
Map with key 'returnType' has different values (tag 3, likely 'FunctionNode')
Map with key 'value' has different values (tag 1, likely 'Something<1>')
Map with key 'function' has different values (tag 6, likely 'Procedure')
Lists have different values at index 0
Map with key 'items' has different values
Map with key 'procedures' has different values (tag 2, likely 'Class')
Lists have different values at index 6
Map with key 'items' has different values
Map with key 'classes' has different values
Lists have different values at index 458
Map with key 'libraries' has different values
Which should be read bottom up as something like
Component -> the 458th library -> the 6th class ->
the 0th procedure -> function -> returnType (a InterfaceType) ->
0th type argument (a TypeParameterType) ->
nullability has value 2 in one input and 3 in the other.
Change-Id: I49007a80ddb53a0ba1fae04b22d6efeae3687724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114602
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This updates the parser to detect constructors vs methods
in classes vs mixins vs extensions. Rather than generating a single
endMethod event and require listeners to determine the type of
declaration, the parser now generates different events for
different types of declarations so that listeners can process
each of these different types separately.
In addition, this lays the groundwork for fixing extension declaration
error messages and moving error generation that is duplicated
in the various listeners into the parser.
Change-Id: Ia86a4bf3e6f1442ca4926c754b66e7d6e86fb47d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This enables the correction of parent pointers for 'lying' parent pointers
(Judgments that contain nodes but who are not their parents). Long term this can
also be used to replace the slow .replaceChild calls with direct updates in the
visitor.
Change-Id: Ibee7efe815937288dea4dc76d524ef44760a7658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114325
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
In the feature specification v1.2 libraries in a package with a default
version wasn't allowed to specify a language version higher than that.
In v1.3 thats allowed as long as its below the sdk limit.
Change-Id: I85f5c36a9c9c427da03fc540f9175195134ad47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Splits strong_test into 4 shards. This test took 4+ minutes locally with
the fast_strong_test and analyze_test ticking in at ~1:45. This change
makes local testing of frontend unittests take 2 instead of 4 minutes in
total.
Change-Id: Id6015de86d547b209a699b1e5196b3edad1e6977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114501
Reviewed-by: Jens Johansen <jensj@google.com>
Dart allows the last switch case to "fall through" the end of the
switch statement. To account for this, we previously required the
caller of FlowAnalysis to calling `handleBreak` at the end of the last
switch case. (In the analyzer implementation we actually only did
this if the last case was a `default` case, but in practice there was
no observable difference).
This CL shifts the responsibility to FlowAnalysis to handle this
scenario; the caller only needs to call `handleBreak` if there is an
actual break statement present.
Change-Id: Ia0d7abb21d78205f1050873e28b30cddc5fbe344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114547
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Responsibility for deciding whether to cancel promotions has been
moved to FlowAnalysis (previously the caller decided). This should
reduce the risk of the analyzer and front end behaviors diverging.
Also removed an unnecessary argument from
FlowAnalysis.switchStatement_end.
Change-Id: Ib015e4e360e62da7bb267057e4626acaa94e9e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114541
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- deprecates 'target' on LibraryBuilder, ClassBuilder, ExtensionBuilder,
TypeAliasBuilder, and TypeVariableBuilder.
- prepares for deprecation of 'target' on MemberBuilder,
VariableBuilder, and FormalParameterBuilder
Change-Id: Ic04c533eb5443c7b7c6413e48f399450d1ebe43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Previously the client was required to create a synthetic `true`
literal. The client may still do that (it's equivalent), but it's no
longer necessary.
Change-Id: Iffa12769b542678dab6cd4b5583d7058b41aebd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114342
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is a step towards decoupling Token from Forest. We should be able to
create nodes without tokens an still provide offsets.
Change-Id: Ifd2499435a12d0b54db1cc374d71cbc51d187f98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114071
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
* Set parent for TypeParameters created in createExpressionEvaluationComponent.
* Resolve references from bytecode to an expression evaluation class
using real class. Expression evaluation class could be referenced
from type parameters.
* Avoid registering expression evaluation classes in hierarchy. They
shouldn't be discovered through direct subclasses or implementors,
as expression evaluation classes don't have cids.
* Add :function_type_arguments_var local variable to bytecode local
variables info, so expression evaluation can find function type
arguments which are in scope.
Change-Id: I515431a989b4d02af4ecf90579931dd59d3acadd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114182
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
We already have an analyzer test in CFE, but because that test also
includes for instance everything that imports the front_end, kernel or
testing, we had to disable lints in that one.
This CL adds an analyzer test for CFE sorces onlyi where lints are
enabled.
Change-Id: Ic58c8c6e92f4a7962bbf5489a37f2bf95a5c095b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114067
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>