Skip to content

Commit 371b7b3

Browse files
committed
Correction: Add definition of normalizedType/topMergeType for member signatures
1 parent 9621eb2 commit 371b7b3

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

specification/dartLangSpec.tex

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11419,7 +11419,7 @@ \subsubsection{Sets}
1141911419
and it is evaluated at run time.
1142011420
Only run-time set literals can be mutated after they are created.
1142111421
% This error can occur because being constant is a dynamic property, here.
11422-
Attempting to mutate a constant set literal
11422+
Attempting to mutate a constant set literal
1142311423
will result in a \DynamicError{dynamic error}.
1142411424

1142511425
\commentary{%
@@ -23106,6 +23106,34 @@ \subsection{Functions Dealing with Extreme Types}
2310623106
and then recursively taking \TopMergeTypeName{} of the rest.
2310723107
\commentary{The ordering of the arguments makes no difference.}
2310823108

23109+
\LMHash{}%
23110+
We generalize \TopMergeTypeName{} such that
23111+
it can be applied to two or more member signatures rather than types.
23112+
The case with more than two member signatures is defined in the same way as
23113+
the case with more than two types.
23114+
With member signatures $m_1$ and $m_2$
23115+
that are structurally identical modulo the choice of top types
23116+
and the occurrences of the modifier \COVARIANT,
23117+
\TopMergeType{$m_1$}{$m_2$} is a member signature $m$ such
23118+
that every pair of types $T_1$ and $T_2$ that occur in $m_1$ respectively $m_2$
23119+
yields \TopMergeType{$T_1$}{$T_2$} in the result,
23120+
the modifier \COVARIANT{} occurs on every parameter in $m$
23121+
where the corresponding parameter in $m_1$ or in $m_2$ has that modifier,
23122+
and all other non-type parts of $m_1$ and $m_2$ occur identically in the result.
23123+
23124+
\commentary{%
23125+
For example,
23126+
23127+
\noindent
23128+
\TopMergeType{\VOID\,\,m(List<\DYNAMIC>)}
23129+
{\DYNAMIC\,\,m(\COVARIANT\,\,List<Object?>)}
23130+
23131+
\noindent
23132+
is the member signature
23133+
\code{Object?\,\,m(\COVARIANT\,\,List<Object?>)}.%
23134+
}
23135+
23136+
2310923137
\LMHash{}%
2311023138
The \IndexCustom{\IsTopTypeName}{isTopType@\IsTopTypeName}
2311123139
predicate is true for any type which is in
@@ -23354,6 +23382,21 @@ \subsection{Type Normalization}
2335423382
\end{displaymath}
2335523383
}
2335623384

23385+
\LMHash{}%
23386+
We generalize \NormalizedTypeOfName{} such that
23387+
it can be applied to a member signature rather than a type.
23388+
This maps a member signature $m$ to a member signature $m'$ such
23389+
that every type $T$ that occurs in $m$ is replaced by
23390+
\NormalizedTypeOf{$T$}, and all other parts of $m'$ are identical to
23391+
the corresponding part of $m$.
23392+
23393+
\commentary{%
23394+
For example,
23395+
\NormalizedTypeOf{\VOID\,\,m(\COVARIANT\,\,FutureOr<Object>)}
23396+
is the member signature
23397+
\code{\VOID\,\,m(\COVARIANT\,\,Object)}.%
23398+
}
23399+
2335723400

2335823401
\subsection{The Canonical Syntax of Types}
2335923402
\LMLabel{theCanonicalSyntaxOfTypes}

0 commit comments

Comments
 (0)