Skip to content

Commit c5c531a

Browse files
authored
Add rule to avoid generating wrong default constructor in mixin application (#4467)
1 parent aca410c commit c5c531a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

specification/dartLangSpec.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6191,6 +6191,18 @@ \subsection{Mixin Application}
61916191
If $S_q$ is a generative const constructor, and $M$ does not declare any
61926192
fields, $C_q$ is also a const constructor.
61936193

6194+
\LMHash{}%
6195+
If $S$ does not declare any generative constructors then the application
6196+
does not implicitly induce any forwarding constructors.
6197+
In particular, it does not induce a default constructor
6198+
(\ref{constructors}).
6199+
6200+
\commentary{%
6201+
The default constructor would have a superinitializer
6202+
that attempts to invoke a constructor that does not exist.
6203+
Developers would have no way to eliminate this error.%
6204+
}
6205+
61946206

61956207
\section{Extensions}
61966208
\LMLabel{extensions}

0 commit comments

Comments
 (0)