-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix substitution of type params #542
Conversation
Use an explicit `'a or_replaced` type to better track where this need to be handled.
| Replaced (TypeExpr.Constr (p, _), _) -> p | ||
| Replaced _ -> (* What else is possible ? *) assert false |
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'm not sure what we should do here. More tests are required
test/xref2/subst/test.md
Outdated
module M/68 : sig | ||
type t/72 | ||
include : S/69 with [root(S/69).t = [(alias (poly_var [ `A of (a * b) ]) b)] t/72] (sig = | ||
val map/73 : ([(alias (poly_var [ `A of (a * b) ]) b)] t/72) -> ((a) -> b) -> [(alias (poly_var [ `A of (b * b) ]) b)] t/72 |
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've found an edge case, the last type is wrong: (alias (poly_var [
A of (b * b) ]) b). We should either rename
bto
c` in this type or choose a free variable before substituting.
What do you think ?
Print type representation in declarations. Print polymorphic variants. Add missing parentheses around arrows arguments and shorten some paths.
Fix #538 and #462
This substitutes recursively type variables when encountering a "replaced" type.