OLD | NEW |
---|---|
1 \documentclass{article} | 1 \documentclass{article} |
2 \usepackage{epsfig} | 2 \usepackage{epsfig} |
3 \usepackage{color} | 3 \usepackage{color} |
4 \usepackage{dart} | 4 \usepackage{dart} |
5 \usepackage{bnf} | 5 \usepackage{bnf} |
6 \usepackage{hyperref} | 6 \usepackage{hyperref} |
7 \usepackage{lmodern} | 7 \usepackage{lmodern} |
8 \usepackage[T1]{fontenc} | 8 \usepackage[T1]{fontenc} |
9 \newcommand{\code}[1]{{\sf #1}} | 9 \newcommand{\code}[1]{{\sf #1}} |
10 \title{Dart Programming Language Specification \\ | 10 \title{Dart Programming Language Specification \\ |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1774 | 1774 |
1775 %The superclass clause of a class C is processed within the enclosing scope of t he static scope of C. | 1775 %The superclass clause of a class C is processed within the enclosing scope of t he static scope of C. |
1776 %\commentary{ | 1776 %\commentary{ |
1777 %This means that in a generic class, the type parameters of the generic are avai lable in the superclass clause. | 1777 %This means that in a generic class, the type parameters of the generic are avai lable in the superclass clause. |
1778 %} | 1778 %} |
1779 | 1779 |
1780 \LMHash{} | 1780 \LMHash{} |
1781 The scope of the \EXTENDS{} and \WITH{} clauses of a class $C$ is the type-param eter scope of $C$. | 1781 The scope of the \EXTENDS{} and \WITH{} clauses of a class $C$ is the type-param eter scope of $C$. |
1782 | 1782 |
1783 \LMHash{} | 1783 \LMHash{} |
1784 %It is a compile-time error if the \EXTENDS{} clause of a class $C$ includes a type expression that does not denote a class available in the lexical scope of $ C$. | 1784 %It is a compile-time error if the \EXTENDS{} clause of a class $C$ includes a type expression that does not denote a class available in the lexical scope of $ C$. |
Lasse Reichstein Nielsen
2016/12/16 11:14:59
Remove the comment, and the one below.
eernst
2016/12/16 11:33:47
Done.
| |
1785 It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a malformed type or a deferred type (\ref{stati cTypes}) as a superclass. | 1785 It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies a t ype variable (\ref{generics}), a type alias (\ref{typedef}), an enumerated type (\ref{enums}), a malformed type, or a deferred type (\ref{staticTypes}) as a sup erclass. |
1786 It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies typ e \DYNAMIC{} as a superinterface. | |
1786 % too strict? Do we e want extends List<Undeclared> to work as List<dynamic>? | 1787 % too strict? Do we e want extends List<Undeclared> to work as List<dynamic>? |
1787 | 1788 |
1788 \commentary{ The type parameters of a generic class are available in the lexical scope of the superclass clause, potentially shadowing classes in the surroundin g scope. The following code is therefore illegal and should cause a compile-time error: | 1789 \commentary{ The type parameters of a generic class are available in the lexical scope of the superclass clause, potentially shadowing classes in the surroundin g scope. The following code is therefore illegal and should cause a compile-time error: |
1789 } | 1790 } |
1790 | 1791 |
1791 \begin{dartCode} | 1792 \begin{dartCode} |
1792 class T \{\} | 1793 class T \{\} |
1793 | 1794 |
1794 /* Compilation error: Attempt to subclass a type parameter */ | 1795 /* Compilation error: Attempt to subclass a type parameter */ |
1795 class G<T> extends T \{\} | 1796 class G<T> extends T \{\} |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1910 \begin{grammar} | 1911 \begin{grammar} |
1911 {\bf interfaces:} | 1912 {\bf interfaces:} |
1912 \IMPLEMENTS{} typeList | 1913 \IMPLEMENTS{} typeList |
1913 . | 1914 . |
1914 \end{grammar} | 1915 \end{grammar} |
1915 | 1916 |
1916 \LMHash{} | 1917 \LMHash{} |
1917 The scope of the \IMPLEMENTS{} clause of a class $C$ is the type-parameter scope of $C$. | 1918 The scope of the \IMPLEMENTS{} clause of a class $C$ is the type-parameter scope of $C$. |
1918 | 1919 |
1919 \LMHash{} | 1920 \LMHash{} |
1920 It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifie s a type variable as a superinterface. It is a compile-time error if the \IMPL EMENTS{} clause of a class $C$ specifies an enumerated type (\ref{enums}), a ma lformed type or deferred type (\ref{staticTypes}) as a superinterface. It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DY NAMIC{} as a superinterface. It is a compile-time error if the \IMPLEMENTS{} c lause of a class $C$ specifies a type $T$ as a superinterface more than once. | 1921 It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type variable (\ref{generics}), a type alias (\ref{typedef}), an enumerated ty pe (\ref{enums}), a malformed type, or a deferred type (\ref{staticTypes}) as a superinterface. |
1922 It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface. | |
1923 It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type $T$ as a superinterface more than once. | |
1921 It is a compile-time error if the superclass of a class $C$ is specified as a su perinterface of $C$. | 1924 It is a compile-time error if the superclass of a class $C$ is specified as a su perinterface of $C$. |
Lasse Reichstein Nielsen
2016/12/16 11:14:59
How does this sentence interact with mixins?
That
eernst
2016/12/16 11:33:47
Good question!
As stated below, we could really j
| |
1922 | 1925 |
1923 \rationale{ | 1926 \rationale{ |
1924 One might argue that it is harmless to repeat a type in the superinterface list, so why make it an error? The issue is not so much that the situation described in program source is erroneous, but that it is pointless. As such, it is an indi cation that the programmer may very well have meant to say something else - and that is a mistake that should be called to her or his attention. Nevertheless, we could simply issue a warning; and perhaps we should and will. That said, prob lems like these are local and easily corrected on the spot, so we feel justified in taking a harder line. | 1927 One might argue that it is harmless to repeat a type in the superinterface list, so why make it an error? The issue is not so much that the situation described in program source is erroneous, but that it is pointless. As such, it is an indi cation that the programmer may very well have meant to say something else - and that is a mistake that should be called to her or his attention. Nevertheless, we could simply issue a warning; and perhaps we should and will. That said, prob lems like these are local and easily corrected on the spot, so we feel justified in taking a harder line. |
1925 } | 1928 } |
1926 | 1929 |
1927 \LMHash{} | 1930 \LMHash{} |
1928 It is a compile-time error if the interface of a class $C$ is a superinterface o f itself. | 1931 It is a compile-time error if the interface of a class $C$ is a superinterface o f itself. |
1929 | 1932 |
1930 \LMHash{} | 1933 \LMHash{} |
1931 Let $C$ be a concrete class that does not have a \code{noSuchMethod()} method di stinct from the one declared in class \cd{Object}. | 1934 Let $C$ be a concrete class that does not have a \code{noSuchMethod()} method di stinct from the one declared in class \cd{Object}. |
(...skipping 6071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8003 | 8006 |
8004 The invariant that each normative paragraph is associated with a line | 8007 The invariant that each normative paragraph is associated with a line |
8005 containing the text \LMHash{} should be maintained. Extra occurrences | 8008 containing the text \LMHash{} should be maintained. Extra occurrences |
8006 of \LMHash{} can be added if needed, e.g., in order to make | 8009 of \LMHash{} can be added if needed, e.g., in order to make |
8007 individual \item{}s in itemized lists addressable. Each \LM.. command | 8010 individual \item{}s in itemized lists addressable. Each \LM.. command |
8008 must occur on a separate line. \LMHash{} must occur immediately | 8011 must occur on a separate line. \LMHash{} must occur immediately |
8009 before the associated paragraph, and \LMLabel must occur immediately | 8012 before the associated paragraph, and \LMLabel must occur immediately |
8010 after the associated \section{}, \subsection{} etc. | 8013 after the associated \section{}, \subsection{} etc. |
8011 | 8014 |
8012 ---------------------------------------------------------------------- | 8015 ---------------------------------------------------------------------- |
OLD | NEW |