[Question][Hw0-2] Regarding specification of Type checking problem #643
Replies: 5 comments
-
I think this is a mistake in the specification document, as there's a test case as follows: assert_equal (type_check (Or (Int 1, ToBool (Int 2)))) TyError ); |
Beta Was this translation helpful? Give feedback.
-
Any expression that is not covered by the type rules will have its type derived to |
Beta Was this translation helpful? Give feedback.
-
But the given example contradicts the test case. The example says I just have this issue still open so that the given example in the document be updated in the future. |
Beta Was this translation helpful? Give feedback.
-
Ah, I see now. The document seems to be wrong in this case. Good find. |
Beta Was this translation helpful? Give feedback.
-
Hi Murad. You are right. This is a typo in the document. Let me fix it. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Name: Murad Bashirov
Hello. In the given examples of problem 5 there's this case:
But given specification of
$$\frac{e_1\colon \texttt{TyBool} \quad e_2\colon \texttt{TyBool}}{\texttt{Or} \hspace{.2777em} e_1 e_2 \colon \texttt{TyBool}}$$
Or
says:which I interpret as, "the arguments of
Or
can only be boolean", but the example contradicts to this and one argument of it isint
. Is there a mistake in specification or am I understanding it incorrectly?Thanks
Beta Was this translation helpful? Give feedback.
All reactions