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

Unified Diff: docs/language/dartLangSpec.tex

Issue 26990005: It's an error if to instantiate a subclass of a malbounded type,or a type variable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
===================================================================
--- docs/language/dartLangSpec.tex (revision 28672)
+++ docs/language/dartLangSpec.tex (working copy)
@@ -511,6 +511,8 @@
\subsubsection{Changes Since Version 0.7}
+\ref{new}: Instantiating subclasses of malbounded types is a dynamic error.
+
\ref{leastUpperBounds}: Extended LUBs to all types.
@@ -3170,7 +3172,7 @@
Then, if $q$ is a non-factory constructor of an abstract class then an \code{AbstractClassInstantiationError} is thrown.
-If $T$ is malformed a dynamic error occurs. In checked mode, if $T$ is malbounded a dynamic error occurs.
+If $T$ is malformed or if $T$ is a type variable a dynamic error occurs. In checked mode, if $T$ or any of its superclasses is malbounded a dynamic error occurs.
Otherwise, if $q$ is not defined or not accessible, a \code{NoSuchMethodError} is thrown. If $q$ has less than $n$ positional parameters or more than $n$ required parameters, or if $q$ lacks any of the keyword parameters $\{ x_{n+1}, \ldots, x_{n+k}\}$ a \code{NoSuchMethodError} is thrown.
Otherwise, if $q$ is a generative constructor (\ref{generativeConstructors}), then:
@@ -5619,8 +5621,8 @@
}
\begin{dartCode}
-\INTERFACE{} I$<$T \EXTENDS{} num$>$ \{\}
-\INTERFACE{} J \{\}
+\CLASS{} I$<$T \EXTENDS{} num$>$ \{\}
+\CLASS{} J \{\}
\CLASS{} A$<$T$>$ \IMPLEMENTS{} J, I$<$T$>$ // type warning: T is not a subtype of num
\{ ...
« 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