Skip to content

Commit ac0594a

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

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
@@ -11743,7 +11743,7 @@ \subsubsection{Sets}
1174311743
and it is evaluated at run time.
1174411744
Only run-time set literals can be mutated after they are created.
1174511745
% This error can occur because being constant is a dynamic property, here.
11746-
Attempting to mutate a constant set literal
11746+
Attempting to mutate a constant set literal
1174711747
will result in a \DynamicError{dynamic error}.
1174811748

1174911749
\commentary{%
@@ -23722,6 +23722,34 @@ \subsection{Functions Dealing with Extreme Types}
2372223722
and then recursively taking \TopMergeTypeName{} of the rest.
2372323723
\commentary{The ordering of the arguments makes no difference.}
2372423724

23725+
\LMHash{}%
23726+
We generalize \TopMergeTypeName{} such that
23727+
it can be applied to two or more member signatures rather than types.
23728+
The case with more than two member signatures is defined in the same way as
23729+
the case with more than two types.
23730+
With member signatures $m_1$ and $m_2$
23731+
that are structurally identical modulo the choice of top types
23732+
and the occurrences of the modifier \COVARIANT,
23733+
\TopMergeType{$m_1$}{$m_2$} is a member signature $m$ such
23734+
that every pair of types $T_1$ and $T_2$ that occur in $m_1$ respectively $m_2$
23735+
yields \TopMergeType{$T_1$}{$T_2$} in the result,
23736+
the modifier \COVARIANT{} occurs on every parameter in $m$
23737+
where the corresponding parameter in $m_1$ or in $m_2$ has that modifier,
23738+
and all other non-type parts of $m_1$ and $m_2$ occur identically in the result.
23739+
23740+
\commentary{%
23741+
For example,
23742+
23743+
\noindent
23744+
\TopMergeType{\VOID\,\,m(List<\DYNAMIC>)}
23745+
{\DYNAMIC\,\,m(\COVARIANT\,\,List<Object?>)}
23746+
23747+
\noindent
23748+
is the member signature
23749+
\code{Object?\,\,m(\COVARIANT\,\,List<Object?>)}.%
23750+
}
23751+
23752+
2372523753
\LMHash{}%
2372623754
The \IndexCustom{\IsTopTypeName}{isTopType@\IsTopTypeName}
2372723755
predicate is true for any type which is in
@@ -23970,6 +23998,21 @@ \subsection{Type Normalization}
2397023998
\end{displaymath}
2397123999
}
2397224000

24001+
\LMHash{}%
24002+
We generalize \NormalizedTypeOfName{} such that
24003+
it can be applied to a member signature rather than a type.
24004+
This maps a member signature $m$ to a member signature $m'$ such
24005+
that every type $T$ that occurs in $m$ is replaced by
24006+
\NormalizedTypeOf{$T$}, and all other parts of $m'$ are identical to
24007+
the corresponding part of $m$.
24008+
24009+
\commentary{%
24010+
For example,
24011+
\NormalizedTypeOf{\VOID\,\,m(\COVARIANT\,\,FutureOr<Object>)}
24012+
is the member signature
24013+
\code{\VOID\,\,m(\COVARIANT\,\,Object)}.%
24014+
}
24015+
2397324016

2397424017
\subsection{The Canonical Syntax of Types}
2397524018
\LMLabel{theCanonicalSyntaxOfTypes}

0 commit comments

Comments
 (0)