From b212403cf824d42ecc57c67cd3813e38cfd7b4db Mon Sep 17 00:00:00 2001 From: Dmitry Stefantsov Date: Fri, 18 Oct 2019 08:46:16 +0000 Subject: [PATCH] [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 Commit-Queue: Dmitry Stefantsov --- pkg/kernel/lib/ast.dart | 24 ++++++++++++------------ runtime/vm/kernel_binary.h | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart index beae35565c2..22ee9226151 100644 --- a/pkg/kernel/lib/ast.dart +++ b/pkg/kernel/lib/ast.dart @@ -5339,18 +5339,6 @@ class _PublicName extends Name { /// Represents nullability of a type. enum Nullability { - /// Nullable types are marked with the '?' modifier. - /// - /// Null, dynamic, and void are nullable by default. - nullable, - - /// Non-nullable types are types that aren't marked with the '?' modifier. - /// - /// Note that Null, dynamic, and void that are nullable by default. Note also - /// that some types denoted by a type parameter without the '?' modifier can - /// be something else rather than non-nullable. - nonNullable, - /// Non-legacy types not known to be nullable or non-nullable statically. /// /// An example of such type is type T in the example below. Note that both @@ -5365,6 +5353,18 @@ enum Nullability { /// } undetermined, + /// Nullable types are marked with the '?' modifier. + /// + /// Null, dynamic, and void are nullable by default. + nullable, + + /// Non-nullable types are types that aren't marked with the '?' modifier. + /// + /// Note that Null, dynamic, and void that are nullable by default. Note also + /// that some types denoted by a type parameter without the '?' modifier can + /// be something else rather than non-nullable. + nonNullable, + /// Types in opt-out libraries are 'legacy' types. /// /// They are both subtypes and supertypes of the nullable and non-nullable diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h index 5296e689b4e..cc562eb991e 100644 --- a/runtime/vm/kernel_binary.h +++ b/runtime/vm/kernel_binary.h @@ -164,9 +164,9 @@ enum ConstantTag { // Keep in sync with package:kernel/lib/ast.dart enum Nullability { - kNullable = 0, - kNonNullable = 1, - kNeither = 2, + kUndetermined = 0, + kNullable = 1, + kNonNullable = 2, kLegacy = 3, };