Johnni Winther
4ff04f641b
[kernel] Add always_declare_return_types lint
...
Change-Id: Icdcc648f42393b28daf648f752e3b4d61f51aa10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212043
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-09-01 16:50:27 +00:00
Johnni Winther
097a511d9f
[kernel] Add annotate_overrides lint
...
Change-Id: I1fffd60eeb14ecd6d5ba30cd584a75ddd4a8acfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212005
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-09-01 11:45:17 +00:00
Sam Rawlins
64c2dd6193
Remove "unnecessary" imports in pkg/kernel
...
In each library where an import is removed, the library uses some elements
provided by the import, BUT there is another import which provides all of the
same elements, and at least one more which the library uses.
In this change, we remove the imports which can be simply removed in favor of
the other already present imports.
See https://github.com/dart-lang/sdk/issues/44569 for more information.
Change-Id: Ifebf11894fd62280b20230aa6d66de41cf6baae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-05-14 20:18:18 +00:00
Johnni Winther
efe0ddccab
[kernel] Reland: Migrate remaining bin/lib libraries in package:kernel
...
Change-Id: I5eacb92ea6ce00d83b3440a473cca8dad0892a87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197165
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-28 14:36:53 +00:00
Dmitry Stefantsov
cc621431f9
[cfe] Implement subtype relation for ExtensionType
...
Change-Id: I725c6abd4ad2ec7fe217e271fbe60d57af443f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196933
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2021-04-27 13:03:38 +00:00
Dmitry Stefantsov
3eaeec5397
[cfe] Add Extensions to the parser in the CFE type tests
...
Change-Id: I796fcab752da42c77414170b661dfe5c42e30aec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196492
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2021-04-23 09:14:01 +00:00
Johnni Winther
69d56fd82a
[kernel] Make TypeParameter.bound non-nullable
...
Change-Id: I31e693a5b77db039c6a2f8ac8ea534ad663ae0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195988
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-20 10:56:56 +00:00
Johnni Winther
3e44898e08
[kernel] Make FileUriNode.fileUri non-nullable
...
TEST=existing
Change-Id: I72583e500cb0b69d9352b040c3e2885f9e0450c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195681
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-04-19 08:03:30 +00:00
Johnni Winther
7e6692b20c
Revert "[kernel] Migrate remaining bin/lib libraries in package:..."
...
Revert submission 195268
Reason for revert: Implicitly triggers running bin/* in sound null safety, revealing an unsafe use of List.length=
Reverted Changes:
I026ace4fd:[cfe] Migrate front_end libraries from wave 3-4
I9ba1f809b:[kernel] Migrate remaining bin/lib libraries in pa...
Change-Id: I3535c45d6eaf970dc5a17b6d7274cd9d6aa16ae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195507
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-15 14:55:37 +00:00
Johnni Winther
9feb5330b9
[kernel] Migrate remaining bin/lib libraries in package:kernel
...
Change-Id: I9ba1f809b0340b6d45471d856f2a31cff9534de8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195264
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-04-15 12:04:28 +00:00
Johnni Winther
7cbdc2f3a2
[kernel] Merge to InvalidType when either input is invalid
...
Change-Id: I9c41988b725cba5f3b8a0cef21132e409dd7e261
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188289
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-03-02 12:11:12 +00:00
Dmitry Stefantsov
c191551fac
[cfe] Remove BottomType
...
TEST=Covered by existing tests.
Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-02-24 13:21:55 +00:00
Dmitry Stefantsov
63737581f8
[cfe] Encourage the use of the const NeverType objects
...
TEST=Covered by existing test base.
Change-Id: Ie858bd5a765d71fa4095eab3373a6ecdb063b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183006
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-02-08 10:36:40 +00:00
Johnni Winther
34fb48bb8a
[kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
...
Migrates libraries dependent only on already migrated libraries.
Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-01-18 15:40:21 +00:00
Dmitry Stefantsov
26fb376bce
[cfe] Use type parser in type schema environment test
...
Bug: https://github.com/dart-lang/sdk/issues/44354
Change-Id: I046ab5856668d3e5c3a69fc6b3bca961d980a8b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174927
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-12-07 15:23:57 +00:00
Dmitry Stefantsov
b4dbbe220c
[cfe] Use type parser in type constraint gatherer tests
...
Closes #44096 .
Bug: https://github.com/dart-lang/sdk/issues/44096
Change-Id: Id977e1ef70a1c17b30aedf072be7e6d2ea812d8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171587
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-11-12 17:25:27 +00:00
Johnni Winther
b38821f39d
[kernel] Enforce lints in pkg/kernel
...
Change-Id: I954f7632f22b552febed2a3140f81245277cb050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171581
Reviewed-by: Jens Johansen <jensj@google.com >
2020-11-11 12:51:28 +00:00
Dmitry Stefantsov
783d83950b
[cfe] Use type parser in type schema elimination tests
...
Closes : #44095 .
Bug: https://github.com/dart-lang/sdk/issues/44095
Change-Id: Iff15b0686557388c4e701075a4f6e4fc16dfa5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170901
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-11-09 16:54:39 +00:00
Dmitry Stefantsov
d54e2bb568
[cfe,ddc,dart2js,vm] Add NullType
...
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/170342/
* https://dart-review.googlesource.com/c/sdk/+/170344/
* https://dart-review.googlesource.com/c/sdk/+/170345/
* https://dart-review.googlesource.com/c/sdk/+/170346/
* https://dart-review.googlesource.com/c/sdk/+/170347/
The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.
Closes #40122 .
TEST=Verified by changes in .expect files in pkg/vm/.
Bug: https://github.com/dart-lang/sdk/issues/40122
Change-Id: Ib8197802fdc69694387ae47ac990c58b3aaab7a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170689
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-11-06 12:43:52 +00:00
Johnni Winther
942f765763
[cfe] Use semantic nullability for "is non-nullable" queries in UP/DOWN
...
Previously declaredNullability was used which missed that FutureOr<Function?>
is nullable.
+ add computation, test and use of NonNull in UP/DOWN
Closes #43742
Change-Id: Icf0b95143a85abb5eec056ee0aea23ef40a5283a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168946
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-10-23 14:58:42 +00:00
Johnni Winther
34f5c9d0b4
[cfe] Implement new async return rules
...
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169
Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-07-06 07:04:40 +00:00
Dmitry Stefantsov
929d5e4a98
[cfe,ddc,dart2js,vm] Add FutureOrType
...
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/
The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.
Closes #40123 .
Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-06-15 12:18:46 +00:00
Dmitry Stefantsov
e53e5f2475
[cfe] Separate nullability and declared nullability
...
For some types it makes sense to distinguish between nullability as a
property of including null and the declared nullability, such as for
type-parameter types and FutureOr types. This CL introduces the
separation between the two concepts. The plan is to use that when
implementing FutureOrType.
Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: I90b45bea768e89c213d021d360a481d38377c682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147903
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2020-05-15 07:38:05 +00:00
Dmitry Stefantsov
dea82cc39a
[cfe] Make instantiation-to-bound algorithm NNBD-aware
...
Closes #40764 .
Bug: https://github.com/dart-lang/sdk/issues/40764
Change-Id: Ia9eff062f54632edbdb26937879742d7a813a07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139643
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-03-20 09:03:41 +00:00
Dmitry Stefantsov
535ee87c21
[kernel] Add NORM implementation
...
Change-Id: I6292a4247ed0c418f2d3d6fa841ed086894c31c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134335
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-02-07 15:00:24 +00:00
Johnni Winther
42f954d5f1
[cfe] Move type parser to package:kernel
...
Change-Id: Icbb37b586dd4113605f9a0959e585586ee94c33c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131836
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-01-21 14:37:32 +00:00
Dmitry Stefantsov
4df5b5458a
[cfe] Implement NNBD-aware lower / upper bound algorithms
...
Change-Id: I1def2843f41938e8aee39d12fc4e2807b0c5a1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126725
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2019-12-12 11:00:21 +00:00
Dmitry Stefantsov
0b9665fc8b
[cfe] Use library's non-nullable modifier when creating new types
...
It's a part of internal cleanup of pkg/kernel and pkg/front_end. The
library's status is queried when the new types are created for it in
order to determine the value of the nullability modifier of the type.
Change-Id: Id653c511d17b3811a26b1751876a6e5036cdbed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125261
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2019-11-21 16:00:25 +00:00
Dmitry Stefantsov
d9d5fbc109
[cfe] Create TypeParameterTypes with default nullabilities
...
Change-Id: I85be937240ba5cc39840e78f374902c1e36521a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124327
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2019-11-19 11:22:43 +00:00
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
Dmitry Stefantsov
515a597710
[cfe] Remove Class.rawType
...
Bug: http://dartbug.com/38224
Change-Id: If0af5487b1d43125738575ee3e0fcd747db54fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117546
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2019-09-19 10:42:10 +00:00
Peter von der Ahé
4f2bdff90b
Rename Program to Component
...
Change-Id: I1a3cc03fba9783807fa637a9d42fdbad68ee7686
Reviewed-on: https://dart-review.googlesource.com/31040
Commit-Queue: Peter von der Ahé <ahe@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2018-03-15 12:22:23 +00:00
Paul Berry
bf15116d0f
Handle FutureOr type when inferring async closures.
...
R=asgerf@google.com , scheglov@google.com
Review-Url: https://codereview.chromium.org/2892593005 .
2017-05-20 20:16:59 -07:00
Konstantin Shcheglov
bdedd6768b
Add a way to use shared CanonicalName root to deserialize Program.
...
This allows for example to add SDK into a Program, then load the
"incomplete" Program A that has only the library A, and name sequences
that references SDK classes. Because we look into the nameRoot which
aleady has SDK CanonicalName(s), we can find these names while filling
the link table and use references which point to the existing SDK
AST nodes. Then we can load another set of library cycles, etc.
At the end we have a set of self-consistent libraries that we can
feed into DillTarget/DillLoader and resolve anothersource target
against it.
This CL is based on https://codereview.chromium.org/2872903005/
which has not been reviewed yet.
R=kmillikin@google.com , paulberry@google.com , sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2874723002 .
2017-05-12 10:42:08 -07:00
Paul Berry
932a749bbc
Begin implementing subtype matching for type inference.
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2856383003 .
2017-05-04 08:40:45 -07:00
Paul Berry
29570728a3
Implement Dart 1.0 LUB algorithm (for interface types) in kernel.
...
Note: I intend to implement the full LUB algorithm (including strong
mode behaviors) in front_end, however this piece of the algorithm
makes sense to be in kernel so that it can take advantage of
_ClassInfo.
R=ahe@google.com , johnniwinther@google.com
Review-Url: https://codereview.chromium.org/2848083002 .
2017-05-01 11:25:47 -07:00