If a TS module name has more than one component (e.g., foo.bar) then we erroneously activate the submodule semantics when encountering a module declaration in the module implementation unit (e.g., module foo.bar;).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This will need a test case.
lib/Frontend/CompilerInstance.cpp | ||
---|---|---|
1598–1612 ↗ | (On Diff #107486) | The strategy we've been using so far is this: components after the first in a module path name submodules (visibility groups within a module). Modules TS modules use only the first name component, which may contain periods if the module name contains periods. So the burden should be on the code that produces a ModuleIdPath to do this flattening, not on consumers of the ModuleIdPath. (FWIW, I think we may want to consider this later, so that import foo.bar; could import either the Modules TS module foo.bar, or the submodule bar of the module map module foo, but that will take some fundamental restructuring of how we model Module objects and their hierarchy.) |
Richard, sorry for the last ping, somehow I missed your review.
I've uploaded a new revision with a test case (note that the issue is with 'module a.b' not 'import a.b' but I have tested both for good measure).
My understanding of your comment is that the rest is ok for now (since there will probably be a redesign in this area). If, however, I misunderstood and you sill want to move the id flattening to the caller, let me know.
I'd still like the id flattening moved to the caller. I don't know when or if the redesign will ever happen, so we should aim for the state of the codebase to be consistent in the interim (which might be forever). I'm fine with that being done as a separate change after this one, though, if you'd prefer.
Do you need someone to commit this for you?
Yes, that would probably be easier.
Do you need someone to commit this for you?
Yes, please, I don't have commit rights. Though if I were given them, I could do that myself (and it would also help with the other patch, I guess).