-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
"No exported member" when Importing an exported "import * as" #1386
Comments
Hmm, in the example above (and the test?), there seems to be a typo |
@dcodeIO Oops haha! 😂 But unfortunately no, that doesn't fix things 😢 |
I did some research on this, it seems like the Though, this kinda makes sense since the namespace is technically in the file, but, I can't seem to find where the namespace is created...Perhaps it's a lazy compilation bug? 🤔 But even if I call a function on the |
A |
Ahhh thanks for the insight 😄 If you don't mind, can you send me a link to where the algorithm is in the code? 😄 |
Sure: The linking starts around here, after the queued collections have been populated during initialization of the original elements (in their respective file). Afterwards the graph of what re-exports what from where is known, but I guess there's something missing during traversal. |
@dcodeIO Thanks for the link! So after looking at my current fork, it seems like I'm in the right place and everything 😄 🎉 SO I'll just keep doing my console log debugging until I catch something funny 😄 |
@dcodeIO So I think I figured out what's wrong, but I'm a bit unsure how to proceed. So if it helps at all, here's my console.log debugging trace 🙃 But from what I'm gathering it seems like the flow is:
So in general, I don't think this is an issue with traversal of the file tree. But perhaps, its more of an error that files don't have Let me know if this makes sense? I've been like going in circles trying to understand what's going on. I finally think I have a realllyyyy good grasp on the flow of logic, and I could hack in a fix, but I figured I'd ask here and do it the right way 😄 cc @dcodeIO or @MaxGraey since either of y'all would probably know what to do 😄 |
Hmm, what should happen for star imports is that the file becomes converted to a namespace via |
I know the title is a bit confusing, but the best way to show off this bug is by just showing the pattern in code 😄
in
tests/compiler/reexport.ts
weexport {}
animport * as
https://github.com/torch2424/assemblyscript/blob/export-star-as/tests/compiler/reexport.ts#L28
Then, if we try to import that export in other AS code, it will erorr:
https://github.com/torch2424/assemblyscript/blob/export-star-as/tests/compiler/rereexport.ts#L1
For example:
It is worth noting that if we
export {exportstar}
along with the other exports, the final wasm module will correctly have the right exports. Seems to just not be working between AS files 😄cc @dcodeIO @MaxGraey 😄
The text was updated successfully, but these errors were encountered: