Skip to content

Commit c7a7251

Browse files
committed
Correction: Add definition of normalizedType/topMergeType for member signatures
1 parent ab9570d commit c7a7251

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
@@ -11770,7 +11770,7 @@ \subsubsection{Sets}
1177011770
and it is evaluated at run time.
1177111771
Only run-time set literals can be mutated after they are created.
1177211772
% This error can occur because being constant is a dynamic property, here.
11773-
Attempting to mutate a constant set literal
11773+
Attempting to mutate a constant set literal
1177411774
will result in a \DynamicError{dynamic error}.
1177511775

1177611776
\commentary{%
@@ -23797,6 +23797,34 @@ \subsection{Functions Dealing with Extreme Types}
2379723797
and then recursively taking \TopMergeTypeName{} of the rest.
2379823798
\commentary{The ordering of the arguments makes no difference.}
2379923799

23800+
\LMHash{}%
23801+
We generalize \TopMergeTypeName{} such that
23802+
it can be applied to two or more member signatures rather than types.
23803+
The case with more than two member signatures is defined in the same way as
23804+
the case with more than two types.
23805+
With member signatures $m_1$ and $m_2$
23806+
that are structurally identical modulo the choice of top types
23807+
and the occurrences of the modifier \COVARIANT,
23808+
\TopMergeType{$m_1$}{$m_2$} is a member signature $m$ such
23809+
that every pair of types $T_1$ and $T_2$ that occur in $m_1$ respectively $m_2$
23810+
yields \TopMergeType{$T_1$}{$T_2$} in the result,
23811+
the modifier \COVARIANT{} occurs on every parameter in $m$
23812+
where the corresponding parameter in $m_1$ or in $m_2$ has that modifier,
23813+
and all other non-type parts of $m_1$ and $m_2$ occur identically in the result.
23814+
23815+
\commentary{%
23816+
For example,
23817+
23818+
\noindent
23819+
\TopMergeType{\VOID\,\,m(List<\DYNAMIC>)}
23820+
{\DYNAMIC\,\,m(\COVARIANT\,\,List<Object?>)}
23821+
23822+
\noindent
23823+
is the member signature
23824+
\code{Object?\,\,m(\COVARIANT\,\,List<Object?>)}.%
23825+
}
23826+
23827+
2380023828
\LMHash{}%
2380123829
The \IndexCustom{\IsTopTypeName}{isTopType@\IsTopTypeName}
2380223830
predicate is true for any type which is in
@@ -24045,6 +24073,21 @@ \subsection{Type Normalization}
2404524073
\end{displaymath}
2404624074
}
2404724075

24076+
\LMHash{}%
24077+
We generalize \NormalizedTypeOfName{} such that
24078+
it can be applied to a member signature rather than a type.
24079+
This maps a member signature $m$ to a member signature $m'$ such
24080+
that every type $T$ that occurs in $m$ is replaced by
24081+
\NormalizedTypeOf{$T$}, and all other parts of $m'$ are identical to
24082+
the corresponding part of $m$.
24083+
24084+
\commentary{%
24085+
For example,
24086+
\NormalizedTypeOf{\VOID\,\,m(\COVARIANT\,\,FutureOr<Object>)}
24087+
is the member signature
24088+
\code{\VOID\,\,m(\COVARIANT\,\,Object)}.%
24089+
}
24090+
2404824091

2404924092
\subsection{The Canonical Syntax of Types}
2405024093
\LMLabel{theCanonicalSyntaxOfTypes}

0 commit comments

Comments
 (0)