-
Notifications
You must be signed in to change notification settings - Fork 453
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 @genType issue with module aliases #6113
Conversation
There are a couple of ways one could try to handle this:
|
30492e4
to
cec3b4b
Compare
@jmagaram would you take a look at this? Notice I changed @genType
module MyModuleAlias = {include MyModule} This should take care of your examples, but still worth double checking. If this works, I will separately look into making in unnecessary to use the |
Yes. I think if you look at my comments in the original issue you can see I suggested that as a possible solution. It is essentially rewriting the whole module in a different place.
…________________________________
From: Cristiano Calcagno ***@***.***>
Sent: Friday, April 7, 2023 7:25:36 PM
To: rescript-lang/rescript-compiler ***@***.***>
Cc: Justin Magaram ***@***.***>; Mention ***@***.***>
Subject: Re: [rescript-lang/rescript-compiler] WIP: Demonstrate @genType issue with module aliases (PR #6113)
@jmagaram<https://github.com/jmagaram> would you take a look at this? Notice I changed the wrapper to add an include:
@genType
module MyModuleAlias = {include MyModule}
This should take care of your examples, but still worth double checking.
If this works, I will separately look into making in unnecessary to use the include, which can be expensive.
—
Reply to this email directly, view it on GitHub<#6113 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADLZYSZX6OA6RRGJ2VURUTTXADECBANCNFSM6AAAAAAWUYMUPI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Great. |
when a module alias is created ```res module A = B ``` expand the definition of B (as in an include) for genType's purposes
@jmagaram take a look now. This is ready for another set of testing. Base on this PR, the way to go is to annotate the aliasing: @genType
module A = B |
Fixes #6112
See #6112
When module aliases
module A = B
are used, the aliasing information is lost if it happens in another file. There's enough logic to adapt the type export in the presence of module aliases. However this works locally, but not in a file that has no type exports and only a module alias.This PR:
@genType
at the leve of modulesB
inmodule A = B