Commit Graph

55 Commits

Author SHA1 Message Date
Chloe Stefantsova 00acecdfbe [model] Upate bench maker and parser for recent type system changes
This CL includes changes to BenchMaker and test type parser that
include recent developments in the DartType system, such as extension
types and record types, outstanding existing features, such as
typedefs, and recent changes in the CFE type model, such as structural
parameters.

Change-Id: I16ca13273e83de7942abad67b8a2b67146fb24bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-23 01:57:10 -07:00
Sigurd Meldgaard 358ae88ba6 Move pkg/kernel to language version 3.6
This is in preparation for https://dart-review.googlesource.com/c/sdk/+/397164
as packages in a workspace need a recent language version.

Change-Id: If1926192209353fab934efe702391ea10ed3573c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2025-01-21 02:52:22 -08:00
Chloe Stefantsova 3393befc99 [cfe] Remove constructors for alpha renaming
In this CL methods StructuralParameterType.forAlphaRenaming,
StructuralParameterType.forAlphaRenamingFromTypeParameter,
TypeParameterType.forAlphaRenaming, and
TypeParameterType.forAlphaRenamingFromStructuralParameter are removed,
and their call sites are replaced with invocations of other
constructors of StructuralParameterType and TypeParameterType. The
reason for this change is call sites having more information for
correct computing of type nullabilities.

In addition to the primary update, the following related changes are
made in this CL.

* Method StructuralParameterType.computeDefaultNullabilityForLibrary
  is renamed into StructuralParameterType.computeDefaultNullability,
  and TypeParameterType.computeDefaultNullabilityForLibrary is renamed
  into TypeParameterType.computeDefaultNullability. The parameter
  `library` is removed from both methods, since it's no longer needed.
* The static methods named `computeNullabilityFromBound` are removed
  from `StructuralParameterType` and `TypeParameterType` and
  re-introduced as instance members in classes `StructuralParameter`
  and `TestParameter` respectively

TEST=existing

Change-Id: I26cccf17ccc9bda1e8b750196f427325b544a7ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-01-07 01:16:48 -08:00
Johnni Winther b2517e934f [cfe] Remove Env.isNonNullableByDefault
+ a few other references of 'isNonNullableByDefault'

Change-Id: Ifcd6bf5c2cc5dbbca7dda1576248fc4cd59eed5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369023
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-03 06:42:54 +00:00
Johnni Winther 1315b3ab72 [kernel] Remove isNonNullableByDefault from checkBounds and instantiateToBounds
Change-Id: Ie1faa72cd1d9eaae65e1fb2fd44bf7a70b94a025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368641
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-30 13:51:46 +00:00
Johnni Winther ae03b57cbb [cfe] Remove .isNonNullableByDefault from package:kernel
This removes the .isNonNullableByDefault properties and similar from
the AST nodes in package:kernel. NNBD is now always enabled so these
properties are trivial.

TEST=existing

Change-Id: I75ca0551ac4b5910ea63530dd0c9c2e68bd01aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-05-15 08:31:38 +00:00
Johnni Winther 12c4e22a4d [cfe] Handle various cases ExtensionType
Handles ExtensionType in inference of MapLiteral, inference of
ObjectPattern, and exhaustiveness.

TEST=tests/extension_type/*

Change-Id: I3284da2c69d875e192cf3f004ee1156e1aedd98b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333160
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-02 10:42:48 +00:00
Chloe Stefantsova de302d7f3b [cfe] Introduce StructuralParameters
This CL introduces StructuralParameter and StructuralParameterType
classes. They are intended to replace TypeParameter and
TypeParameterType respectively where those were used as type
parameters defined by FunctionTypes. Previously, type parameters of
FunctionTypes were represented by TypeParameter objects with the
‘parent’ field set to null. By introducing StructuralParameter and
StructuralParameterType this CL unambiguously separates the two
notions of type parameters.

TEST=existing

Change-Id: Ida3feb7ad96a7b2acef55840eacba9e36bf2a3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312264
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-25 10:44:41 +00:00
Johnni Winther a6de8d5468 [cfe] Implement subtyping for ExtensionType
Change-Id: I5c8d76083190945eaa5c2fbb43ad0d94dea7540f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319482
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-15 09:39:35 +00:00
Johnni Winther bf9ea56ff7 [kernel] Remove nodes used for the old 'extension-types' experiment
This removes ExtensionType, ExtensionTypeShowHideClause and
CallSiteAccessKind from package:kernel which where only used by the now
removed 'extension-types' experiment.

A follow-up CL will rename InlineClass/InlineType to
ExtensionTypeDeclaration/ExtensionType to match the names of the
Extension Type feature currently being implemented.

TEST=existing

Change-Id: I58d2e8b0a92ac61329ee161cc6884a2c0e6f87ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316420
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-07-27 10:47:08 +00:00
Johnni Winther 82e3a751a9 [cfe] Remove unnecessary_null_comparison code
The frontend is now run with sound null safety so these are no longer needed.

TEST=existing

Change-Id: I6c1776845854695ff34e310a3bb5bc9d86715f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307901
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-08 08:46:47 +00:00
Johnni Winther 36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00
Johnni Winther 5476e3bd6e [kernel] Rename InterfaceType.className to classReference
+ Name.libraryName -> libraryReference

Change-Id: I25b5022ea87f92fb5837f03d29f1671f0e68261b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304740
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-01 06:43:46 +00:00
Johnni Winther d412939c3b [cfe] Use isNonNullableByDefault instead of [Library]
This replaces the [Library] parameter from bounds checks and
type inference methods with a `isNonNullableByDefault` parameter,
enabling usage of these algorithms in library-agnostic code, like
features only available post-nnbd.

Change-Id: Id565d00e1c20d25e7e3388badbb2d7f11c015802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284642
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-22 21:28:28 +00:00
Chloe Stefantsova d4a8100908 [cfe] Implement subtype relationship for record types
Part of https://github.com/dart-lang/sdk/issues/49713

Change-Id: I736a4e4f4ba09a80dda1409a1c6640a64ab560f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-08-29 10:05:35 +00:00
Lasse R.H. Nielsen 8a883fa54d Change : to = for default values in pkg.
Leaves some in parser test:
 pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart

TEST=Refactoring, covered by existing tests.

Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-08-24 15:57:16 +00:00
Chloe Stefantsova 1611fe6f45 [cfe] Separate out IntersectionType from TypeParameterType
TEST=Covered by existing tests

Change-Id: Ie7b99b1c109edff5198cfbf5d22e1cfb1dc130d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253665
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-08-18 08:47:29 +00:00
Johnni Winther 5222bfd90c [cfe] Refactor bounds checking
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>
2022-05-17 14:36:19 +00:00
Nate Bosch 33e174084a Replace Uri.scheme == with Uri.isScheme
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.

TEST=No behavior changes.

Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-02-08 21:38:57 +00:00
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