Commit Graph

1156 Commits

Author SHA1 Message Date
Dmitry Stefantsov b4554c1215 [cfe] Make nullability a required parameter for types
Change-Id: Id787291294cafb15cf4ecad4a9db9da4c6066638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124135
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-07 13:24:47 +00:00
Aske Simon Christensen c504476dc4 [CFE] Extend verifier to check constants.
Add a flag to the verifier that tells it to assume that full constant
evaluation has been performed. It will then complain about anything
that should not be there after constant evaluation.

Also fix two bugs exposed by the new checks:
- The constant transformer did not visit annotations on type parameters
  in function nodes.
- The InstanceCreation constructor did not set the parent pointers of
  its children.

Change-Id: Ieef865a51892918e524da973b0cbaf52ed467181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-11-07 09:53:26 +00:00
Dmitry Stefantsov 24f1f313a2 [cfe] Implement the rest of the NNBD-aware subtype relation
Closes #38673.

Bug: http://dartbug.com/38673
Change-Id: I83fd29be0b6b74b8238a8a07c60d95365871c955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124132
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-06 11:00:21 +00:00
Kallen Tu 11b1433756 Allow downwards inference of sound constructor calls.
Change-Id: Iffe2c6c052cfba40000c0325f5f1fd4ce9b51b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123941
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-06 00:30:07 +00:00
Johnni Winther 75dc8483ab [kernel] Include promoted bound in TypeParameterType equality
Change-Id: I30edcf2ea454efd6e2a1750e826e1a160b7e154a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124125
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-05 13:06:51 +00:00
Jens Johansen f91ef3afd7 [kernel] Deprecate Library.isExternal
We're deprecating kernels Library.isExternal as it wasn't used for
what it was originally intended. It will hopefully go away entirely
soon.

Change-Id: If363c50af5607febae68865875af452c106fff85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123721
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-04 09:24:02 +00:00
Kallen Tu 94e312f7a6 Added errors for variance positions in method members.
When an explicitly defined type variable is used in an incorrect
variance position in a method (whether in the return or the
parameters), an error is emitted.

Change-Id: I7e49687579bb2ce6e293b052b657b98741cb04f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122740
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-31 18:26:43 +00:00
Dmitry Stefantsov 2897bebdef [cfe] Resolve serialization mismatch due to variance computation
Change-Id: Id38c63f5bd659f21423d802fd6180aa04465712c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123406
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-31 10:15:29 +00:00
Kallen Tu 48fbd1aa2b Throw exception when calling defaultDartType in VarianceCalculator.
Prevents the variance computation from silently, and unintentionally
work with new types that may be added in the future.

Change-Id: I94f6b25b26a919cc7cfe6e4b41030f5dd497d5d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123463
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-30 17:03:14 +00:00
Johnni Winther 3ccdb01fc9 [cfe] Handle extensions exported through multiple libraries
Closes #39160

Change-Id: I605b1a95ddab822848b33244b3130ebf16b69842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123523
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-30 11:59:44 +00:00
Dmitry Stefantsov 9910fa8454 [cfe] Implement the first part of NNBD-aware isSubtypeOf
This CL is a squashing of the following smaller CLs:

* https://dart-review.googlesource.com/c/sdk/+/120669/
* https://dart-review.googlesource.com/c/sdk/+/120670/
* https://dart-review.googlesource.com/c/sdk/+/121331/
* https://dart-review.googlesource.com/c/sdk/+/121381/
* https://dart-review.googlesource.com/c/sdk/+/121383/
* https://dart-review.googlesource.com/c/sdk/+/121620/
* https://dart-review.googlesource.com/c/sdk/+/121707/
* https://dart-review.googlesource.com/c/sdk/+/122144/
* https://dart-review.googlesource.com/c/sdk/+/122360/
* https://dart-review.googlesource.com/c/sdk/+/122381/
* https://dart-review.googlesource.com/c/sdk/+/122783/
* https://dart-review.googlesource.com/c/sdk/+/122787/

Change-Id: I9d850f531f0fce07055ff9b5cd39abb605752005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122868
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-25 16:37:39 +00:00
Johnni Winther 22856e5d86 [infra] Bump VERSION to 2.7.0
TBR=whesse@google.com

Change-Id: Id73807b571056de253f7bced407402fa9a6d9181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-25 09:37:34 +00:00
Jens Johansen 18fa7485ad [kernel] Read ContinueSwitchStatements in nested FunctionNodes correctly
Closes #39040

Change-Id: I8ae9a89cfd750dddbf0a994e93d9b2aa2d46490c
Fixed: 39040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122386
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-23 08:34:27 +00:00
Kallen Tu 4601bd7bff Modified supertype check error message to be more descriptive.
Change-Id: I3068bf195eb9a746d25ac62007eaeac0296d3087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121463
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-22 16:59:16 +00:00
Jens Johansen 0449905e2d [CFE] Add a serialization-and-unserialization step to strong test
Change-Id: Icb6275e9eaec0bbdd890719d780a0218fa660fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-22 13:40:01 +00:00
Johnni Winther b1b4f6b7e4 [cfe] Allow assignment to late final fields/variables
Change-Id: I0264904fe6f24f4021cef3d6576b54e11fe0a4d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122143
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-21 12:38:51 +00:00
Jens Johansen d40c8a0573 [kernel] Add 'leakingDebugToString' to nodes
This serves two purposes:
1) It can aid in debugging to better know which object you have.
2) It paves the way for a future re-design of toString so toString never
   leaks.

Change-Id: Ice32209b19b961b7e92de829d8bee0ddd8bd6e93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122140
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-18 10:43:58 +00:00
Dmitry Stefantsov b212403cf8 [cfe] Change integer values that encode nullability attributes
This CL also completes the renaming of "neither" into "undetermined" by
renaming kNeither value in the nullability enum in
runtime/vm/kernel_binary.h into kUndetermined.

Change-Id: Ia266bf1b35577212b696fb4a093340ee8e986256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121989
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-18 08:46:16 +00:00
Dmitry Stefantsov a61c775db8 [cfe] Rename "neither" nullability into "undetermined"
Change-Id: Iad242e4ae11147a4d49a7b19c78c09dcb2977188
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121981
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-17 14:39:30 +00:00
Johnni Winther c6cb89c622 [cfe] Replace child nodes in parent nodes on post-traversal
Replace child nodes in parent nodes on post-traversal instead of using
TreeNode.replaceChild and TreeNode.replaceWith

Change-Id: I2f6f908dce0cd38f1d9a68d4183810e2e0cdca71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121622
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-17 12:56:49 +00:00
Jens Johansen 95991df628 [CFE] Fix crash with duplicate field and constructor initialization
Fixes #38938

Bug: 38938
Change-Id: Icee8187c2237289640cf7bfa763c8e614c5f1cb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121858
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-17 10:47:53 +00:00
Kallen Tu 7b135fc7a6 Differentiate between legacy and sound covariance.
Used to separate the behaviour without the variance experiment flag
turned off and with the flag turned on. Allows for more specific error
descriptions and allows the backend to avoid emitting variance
annotations for legacy covariance and only when the experiment is
enabled, otherwise there is no way of knowing whether the variance is
user specified.

Change-Id: Ia3070a1358e9b0fef10a3ce5057df881b9659832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121140
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-16 18:18:06 +00:00
Dmitry Stefantsov 23e8f2bcfa [cfe] Verify that Null is always nullable
Closes #38360.

Bug: http://dartbug.com/38360
Change-Id: I073a63bc968f1955a3c23bb8ed42e07b5955568a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120668
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-16 11:25:02 +00:00
Kallen Tu b3df8aaa12 Change subtype checking with variance for assignments and methods.
Change-Id: I2594c8749ee445a02e06f82c65cd34a62fc77a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120744
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-11 19:44:05 +00:00
Johnni Winther 42dcdf903c [cfe] Handle promoted type variables in getStaticType
Change-Id: I05a748ec800c7c18a52f8444ad030208ea14d268
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121325
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-11 19:04:48 +00:00
Jens Johansen b8aef62abd [kernel] Effectively clear extension members before adding new ones when loaing dill if 'shouldWriteData'
Prior to this change, loading a dill with extensions in it twice,
would mean getting the extension members twice.

Change-Id: I766a4a6b0ade98ce9af803db0c696e64821e015a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121064
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-11 07:33:03 +00:00
Johnni Winther 72bae7be70 [cfe] Handle all bounds checks on extension methods.
Closes #38755

Change-Id: I3d5449950ecb3268436a3033ae16bac590a1e4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120790
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-09 19:50:02 +00:00
Jens Johansen f09edd1d32 [CFE] Add incremental serializer
Add an incremental serializer that can be used to avoid re-serializing
the same thing again and again.
It does this by grouping libraries into Components / bundles,
serializing them individually and using the concatenated dill feature to
output the wanted data --- just potentially faster if we had the data
in cache.

Note that the serialized output might contain *more* than the input given
if we cached the wanted data into a bigger bundle.
The output will always be "closed" though, i.e. if the stuff that is
included that is too much added a new dependency, that dependency will be
included as well.
This should generally make it safe, although one can imagine situations
where it could pull in lots of dependencies that it wouldn't otherwise
have.

It is being driven by the incremental compiler which makes sure to
invalidate the cache when the data changes.

Except for situations where the libraries are changed externally after
being serialized, but before being serialized again, where one then wants
the updated library serialized, the feature should be safe.

Change-Id: I2a504abe6dbb68434c3b04abff13480ef72a6a6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120786
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 13:28:12 +00:00
Jens Johansen 6ebf3f0889 [kernel] Clear a few lists when loading dill
Prior to this change, loading the sdk dill twice for instance would
result in additional exports as well as parameter counts doubling,
essentially destroying the result.

Change-Id: I4d694bec1926d6df6572e9bb36e8a88ec0822e27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120785
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-09 10:34:07 +00:00
Jens Johansen 05f56ef160 [kernel] Fix printing of additional exports
Change-Id: I65ee82646555cd31eccad33e3a125f0ef2af3a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120784
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 10:10:33 +00:00
Johnni Winther 46a9273664 [cfe] Opt in to NNBD using experimental flag _and_ version number
+ add testing of nnbd types and opt-out in static_types_test

Closes #38287

Change-Id: I019753a74cdc6980dadb0608f7ac486c127af6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120666
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-09 08:43:03 +00:00
Kallen Tu e3ca5ee6ba Check variance of type-parameter use in supertypes.
Tests have both correct and erroneous implementations
of variance.

Change-Id: I49dd76f42399015dd6e3f9688e598c271ce7ab1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119722
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-08 21:33:40 +00:00
Johnni Winther 9276d50fdc [cfe] Remove Severity.errorLegacyWarning
Change-Id: I1cc7a34af307b9edee4c92e43e8607a450cf471d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120585
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-08 09:16:47 +00:00
Ryan Macnak d65a60db00 [vm, bytecode] Populate bytecode cache when initializing an incremental compiler from a kernel file.
AST
"without_change_elapsed_time_ms": 2863,
"implementation_change_elapsed_time_ms": 6009,
"interface_change_elapsed_time_ms": 5888,
"with_coverage_time_ms": 2884

BYTECODE BEFORE
"without_change_elapsed_time_ms": 5216,
"implementation_change_elapsed_time_ms": 8517,
"interface_change_elapsed_time_ms": 8895,
"with_coverage_time_ms": 5462

BYTECODE AFTER
"without_change_elapsed_time_ms": 3384,
"implementation_change_elapsed_time_ms": 8139,
"interface_change_elapsed_time_ms": 8073,
"with_coverage_time_ms": 3473

Change-Id: Ic8e1c183070cb6019ea48f16c04ea5363df41a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 23:53:42 +00:00
Alexander Markov 5a2a5204dd [kernel] Fix metadata_test in presence of control flow collections
Block nodes inside BlockExpression are not serialized separately in
kernel binary, so attached metadata is not preserved.

This change fixes Fixes pkg/kernel/test/metadata_test test failure
revealed by https://dart-review.googlesource.com/c/sdk/+/119520.

Change-Id: I38c2cde6311e001f16faf2641762aaf42dd6d2b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119527
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-02 15:53:04 +00:00
Dmitry Stefantsov bdf6b9505e [cfe] Ask for subtype checking mode explicitly
The interpretation of the subtype check result depends on the mode.  In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings.  In full NNBD mode all such errors are errors.  This CL adds
the mode explicitly to the interface of the subtype check as a parameter.

Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-02 11:30:29 +00:00
Dmitry Stefantsov c1616157d1 [cfe] Use a class instead of the enum for subtype check results
Bug: http://dartbug.com/38673
Change-Id: I3f435c1c9b214ac822e6892849dddc9f6be8a462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119544
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-02 11:30:29 +00:00
Dmitry Stefantsov be43bce0b6 [cfe] Make interface of subtype checks aware of nullabilities.
Change-Id: Id4dbd2c903a36df511f7d638d24dc63f8a9344c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119541
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-02 11:30:29 +00:00
Jens Johansen 84848b1467 [kernel] Add VM pragma prefer-inline to certain methods in kernel serialization
In my measurements this changes the time it takes to write the sdk by
-11.1274% +/- 0.624366% (via slightly modified
pkg/kernel/test/binary_bench.dart AstToBinary out/ReleaseX64/vm_platform_strong.dill)

Change-Id: I4c5cbe17f42b70ef361b2edda0b33c8fc1727b63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-01 12:03:42 +00:00
Johnni Winther 8218857032 [kernel] Handle Extension in BianryBuilderWithMetadata
Change-Id: Iba967214e592d6836863ac523850ec573bd40998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119335
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-01 08:15:50 +00:00
Ryan Macnak 14983a2941 [vm/bytecode] Add timeline events for major compilation phases.
Change-Id: Ie2a1f8a5979bb58133535b7698c5137d4ab2b046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118648
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-30 16:36:09 +00:00
Dmitry Stefantsov 902a36e36f [cfe] Thread nullability of typedef types from source into Kernel
Closes #38214, #38215.

Bug: http://dartbug.com/38214
Bug: http://dartbug.com/38215
Change-Id: I6f96668f3dc7b315b0848a8d8953783ceb5f1c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119326
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-30 12:52:29 +00:00
Dmitry Stefantsov b361639a74 [cfe] Account for nullability in type substitution on TypeBuilders
Closes #37689.

Bug: http://dartbug.com/37689
Change-Id: Ifac30bede3dbec9008e31e5fc81014cc69069afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119145
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-30 12:52:29 +00:00
Dmitry Stefantsov 7d75eb1fd9 [cfe] Account for nullability in type substitution on DartTypes
Bug: http://dartbug.com/37689
Change-Id: I5c37f0e13da956285300288cffc58263e67ac302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-30 12:52:29 +00:00
Johnni Winther e52542b421 [cfe] Handle generic return types
Returns types on generic methods in generic extension that contained
type variables declared on the generic method were not substituted,
leaving these as unindexed type parameters during serialization.

Change-Id: I4f53005318ba2be014bfe6e92f4f6c93288f2a4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118995
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-30 10:58:05 +00:00
Johnni Winther dd028547ce [cfe] Support patching of extension methods
Change-Id: I453e17e63f97a0ca2477371541c6a9602bee2404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119322
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-30 09:51:31 +00:00
Kallen Tu 134839098b Serialization/Deserialization for Variance in Type Parameters.
Change-Id: I9bce86293c23c4b9d2b8011e866f04bcab80e74a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118881
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-09-27 16:57:00 +00:00
Kallen Tu 327bc451f8 Added variance support in listeners to ast.
Pass variance data to field in TypeParameter through the listeners.
ast_to_text will print variances for classes and mixins if specified.

Avoids serialization/deserialization (impl in future CL).

Change-Id: I298537604823710f0d30001f4cb5f1e81530959f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118464
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-26 18:11:10 +00:00
Dmitry Stefantsov e034104f04 [cfe] Remove TypeEnvironment.*Type getters
The getters were returning types of undefined nullabilities.  Now the
nullability-aware getters on CoreTypes should be used instead.

Closes #38224.

Bug: http://dartbug.com/38224
Change-Id: I617a0ef8ee17ebd792c2bc1ec6477a5ee469fee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118570
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-25 13:28:28 +00:00
Dmitry Stefantsov adbfe7ce05 [cfe] Update the rules for TypeParameterType.nullability
Closes #38220.

Bug: http://dartbug.com/38220
Change-Id: If200e1173bd36997715003cc87c35a8e17f4e115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118561
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-25 08:15:47 +00:00