Skip to content

Commit fbaa2e2

Browse files
authored
[spec] Fix catch validation rule (#1874)
1 parent 4ef3759 commit fbaa2e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

document/core/valid/instructions.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -2117,15 +2117,15 @@ Control Instructions
21172117

21182118
* The label :math:`C.\CLABELS[l]` must be defined in the context.
21192119

2120-
* The :ref:`result type <syntax-resulttype>` :math:`[t^\ast]` must be the same as :math:`C.\CLABELS[l]`.
2120+
* The :ref:`result type <syntax-resulttype>` :math:`[t^\ast]` must :ref:`match <match-resulttype>` :math:`C.\CLABELS[l]`.
21212121

21222122
* Then the catch clause is valid.
21232123

21242124
.. math::
21252125
\frac{
21262126
\expanddt(C.\CTAGS[x]) = [t^\ast] \toF []
21272127
\qquad
2128-
C.\CLABELS[l] = [t^\ast]
2128+
C \vdashresulttypematch [t^\ast] \matchesresulttype C.\CLABELS[l]
21292129
}{
21302130
C \vdashcatch \CATCH~x~l \ok
21312131
}
@@ -2159,13 +2159,13 @@ Control Instructions
21592159

21602160
* The label :math:`C.\CLABELS[l]` must be defined in the context.
21612161

2162-
* The :ref:`result type <syntax-resulttype>` :math:`C.\CLABELS[l]` must be empty.
2162+
* The :ref:`result type <syntax-resulttype>` :math:`[]` must :ref:`match <match-resulttype>` :math:`C.\CLABELS[l]`.
21632163

21642164
* Then the catch clause is valid.
21652165

21662166
.. math::
21672167
\frac{
2168-
C.\CLABELS[l] = []
2168+
C \vdashresulttypematch [] \matchesresulttype C.\CLABELS[l]
21692169
}{
21702170
C \vdashcatch \CATCHALL~l \ok
21712171
}

0 commit comments

Comments
 (0)