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

Unified Diff: docs/language/dartLangSpec.tex

Issue 1184183010: Revise static typecheck rules for for-in. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: correction Created 5 years, 6 months 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 dea314b4ddab95ee05acb006f8beba55c6bcb373..7e216e52aa14f5a026bbafab9815ac4a62dfaadf 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -5683,18 +5683,8 @@ var n0 = $e$.iterator;
$s$
\}
\end{dartCode}
-where \code{n0} is an identifier that does not occur anywhere in the program.
+where \code{n0} is an identifier that does not occur anywhere in the program, except that for purposes of static typechecking, it is checked under the assumption that $n0$ is declared to be of type $T$, where $T$ is the static type of $e.iterator$.
-\commentary{
-Note that in fact, using a \CONST{} variable would give rise to a compile time error since \cd{n0.current} is not a constant expression.
-}
-
-It is a static warning if the static type of $e$ does not have a member \cd{iterator}. It is a static warning if the static type of \cd{$e$.iterator} does not have a method \cd{moveNext}. It is a static warning if static return type of \cd{$e$.iterator.moveNext()} is not assignable to the static type of \cd{id}.
-
-
-\commentary {
-One might have required that \cd{n0} had type \cd{Iterable$<T>$} where $T$ was the static type of \cd{id}. However, that would cause failure in checked mode if $e$ was merely emulating the \cd{Iterable} interface.
-}
\subsubsection{Asynchronous For-in}
« 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