-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove coercion with 2 types, which is only supported in ml syntax. #6829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be problematic for the editor tooling/other things that read the compiler artifacts?
jscomp/ml/typedtree.mli
Outdated
| Texp_coerce of core_type option * core_type | ||
(** E :> T [Texp_coerce (None, T)] | ||
E : T0 :> T [Texp_coerce (Some T0, T)] | ||
| Texp_coerce of core_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be problematic for the editor tooling/other things that read the compiler artifacts?
@zth good question.
This should be Texp_coerce of unit * core_type
so for old compiler versions will produce a .cmt
that has the rhs core_type
in the right place (and the lhs apparing to be None).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll make it work I take it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how things are represented in OCaml and what can break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At runtime unit
is 0
just like None
, so the new representation will generate files that appear as valid also in the old representation.
There are two forms of type coercion: 1 `e: t0 :> t` 2 `e :> t` The first form was never supported in .res syntax, and is now removed from parsed and typed tree. That said, coercion 1 is the only one that ever supported coercion with free variables. So this is subject to more investigation. See #6828
3beb1fa
to
0a39286
Compare
By adding a unit argument to the payload.
0a39286
to
8af7d6c
Compare
There are two forms of type coercion:
1
e: t0 :> t
2
e :> t
The first form was never supported in .res syntax, and is now removed from parsed and typed tree.
That said, coercion 1 is the only one that ever supported coercion with free variables. So this is subject to more investigation.
See #6828