Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2802)

Unified Diff: docs/language/dartLangSpec.tex

Issue 2555343004: Make Null act like the bottom type for all the (default nullable) types. (Closed)
Patch Set: Address comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/language/dartLangSpec.tex
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index 8232a3b4554b93cacaa92e9b401d0c7e8bc3ae9d..44e846cf68a64ec44684977b2179c3719e95b50b 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -2616,10 +2616,7 @@ The null object is the sole instance of the built-in class \code{Null}. Attempti
The \code{Null} class declares no methods except those also declared by \code{Object}.
\LMHash{}
-The static type of \NULL{} is $\bot$.
-
-\rationale{The decision to use $\bot$ instead of \code{Null} allows \NULL{} to be be assigned everywhere without complaint by the static checker.
-}
+The static type of \NULL{} is the \code{Null} type.
\subsection{Numbers}
@@ -7369,11 +7366,6 @@ If $I$ is listed in the \EXTENDS{} clause of $J$% or an interface injection decl
\item If $J$ is a mixin application (\ref{mixinApplication}) of the mixin of $I$.
\end{itemize}
-\commentary{
-
-
-}
-
%\Q{Can wacky stuff happen with interface injection, e.g., a direct superinterface becomes indirect? What about side effects - loading order can affect type relationships.
%}
@@ -7381,8 +7373,9 @@ If $I$ is listed in the \EXTENDS{} clause of $J$% or an interface injection decl
A type $T$ is more specific than a type $S$, written $T << S$, if one of the following conditions is met:
\begin{itemize}
\item $T$ is $S$.
-\item T is $\bot$.
-\item S is \DYNAMIC{}.
+\item $T$ is $\bot$.
+\item $T$ is \NULL{} and $S$ is not $\bot$.
Leaf 2017/01/18 00:58:36 Should \NULL{} here be \code{Null}?
Lasse Reichstein Nielsen 2017/01/20 08:03:16 Done.
+\item $S$ is \DYNAMIC{}.
\item $S$ is a direct supertype of $T$.
\item $T$ is a type parameter and $S$ is the upper bound of $T$.
\item $T$ is a type parameter and $S$ is \cd{Object}.
@@ -7409,7 +7402,7 @@ $S$ is a supertype of $T$, written $S :> T$, iff $T$ is a subtype of $S$.
\commentary{The supertypes of an interface are its direct supertypes and their supertypes. }
\LMHash{}
-An interface type $T$ may be assigned to a type $S$, written $T \Longleftrightarrow S$, iff either $T <: S$ or $S <: T$.
+An interface type $T$ may be assigned to a type $S$, written $T \Longleftrightarrow S$, iff either $T <: S$, $S <: T$, or either $T$ or $S$ is the \code{Null} type.
Leaf 2017/01/18 00:58:36 Why is this last bit needed, given the subtyping/a
Lasse Reichstein Nielsen 2017/01/20 08:03:16 It's not. Good catch.
\rationale{This rule may surprise readers accustomed to conventional typechecking. The intent of the $\Longleftrightarrow$ relation is not to ensure that an assignment is correct. Instead, it aims to only flag assignments that are almost certain to be erroneous, without precluding assignments that may work.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698