You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typet= {
y : int
}
letx= {"x" : { y : 3}}
letu : t=x["x"]
Here the nested record is still interpreted as structural type.
It used to work this way for two reasons:
record was compiled as an array
the ocaml syntax is quite heavy for nested structual objects, so I chose to inherit, otherwise it would be as below which is too verbose
[%obj{x = [%obj{y =3}]]
To fix this, the work may be done on my side (the internal ppx), for rescript syntax, the structural objects will not be inherited.
This would be a breaking change for rescript syntax (in a good way).
Note this is not an issue in type space, since object types have different syntax < x : int> vs {x:int}
Question: does it make sense to change the semantics of ocaml syntax as well, not inherit the structual property inside the nested objects?
The text was updated successfully, but these errors were encountered:
Here the nested record is still interpreted as structural type.
It used to work this way for two reasons:
To fix this, the work may be done on my side (the internal ppx), for rescript syntax, the structural objects will not be inherited.
This would be a breaking change for rescript syntax (in a good way).
Note this is not an issue in type space, since object types have different syntax
< x : int>
vs{x:int}
Question: does it make sense to change the semantics of ocaml syntax as well, not inherit the structual property inside the nested objects?
The text was updated successfully, but these errors were encountered: