You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/language/dartLangSpec.tex
+44-8Lines changed: 44 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,10 @@
21
21
% 2.1
22
22
% - Remove 64-bit constraint on integer literals compiled to JavaScript numbers.
23
23
% - Allow integer literals in a double context to evaluate to a double value.
24
+
% - Specify dynamic error for a failing downcast in redirecting factory
25
+
% constructor invocation.
26
+
% - Specify that type arguments passed in a redirecting factory constructor
27
+
% declaration must be taken into account during static checks.
24
28
%
25
29
% 2.0
26
30
% - Don't allow functions as assert test values.
@@ -1645,6 +1649,23 @@ \subsection{Constructors}
1645
1649
A {\em constructor name} always begins with the name of its immediately enclosing class, and may optionally be followed by a dot and an identifier \id.
1646
1650
It is a compile-time error if the name of a constructor is not a constructor name.
1647
1651
1652
+
\LMHash{}
1653
+
The {\em function type of a constructor} $k$ is the function type whose
1654
+
return type is the class that contains the declaration of $k$,
1655
+
and whose formal parameter types, optionality, and names of named parameters
1656
+
correspond to the declaration of $k$.
1657
+
1658
+
\commentary{
1659
+
Note that the function type $F$ of a constructor $k$ may contain
1660
+
type variables declared by the enclosing class $C$.
1661
+
In that case we can apply a substitution to $F$, as in
1662
+
$[T_1/X_1, \ldots, T_m/X_m]F$,
1663
+
where $X_j, j \in1 .. m$ are the formal type parameters of $C$
1664
+
and $T_j, j \in1 .. m$ are specified in the given context.
1665
+
We may also omit such a substitution when the given context is
1666
+
the instance scope of $C$, where $X_1, \ldots, X_m$ are in scope.
1667
+
}
1668
+
1648
1669
\commentary{
1649
1670
A constructor declaration may conflict with static member declarations
0 commit comments