Skip to content

Commit 844bfb4

Browse files
committed
Correction: Add definition of normalizedType/topMergeType for member signatures
1 parent 0704c54 commit 844bfb4

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

1175311753
\commentary{%
@@ -23726,6 +23726,34 @@ \subsection{Functions Dealing with Extreme Types}
2372623726
and then recursively taking \TopMergeTypeName{} of the rest.
2372723727
\commentary{The ordering of the arguments makes no difference.}
2372823728

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

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

2397824021
\subsection{The Canonical Syntax of Types}
2397924022
\LMLabel{theCanonicalSyntaxOfTypes}

0 commit comments

Comments
 (0)