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
Note that this is a module that takes place in two separate files. I am attempting to access a method of x from a file where x was not specifically declared, but it was declared for the module.
If you combine File 1 and File 2 to get something like this:
//FILE 1
module Test{varx : WebGLRenderingContext;exportclassTest1{//Assume x is initialized}exportclassTest2{//Assume member method clearColor() is called on x//Works fine}}
everything works fine. The only solution I have found was to export the variable in the first file. However, the reason I'm not exporting it already is because I don't want the variable to visible outside the module.
Could someone explain why two modules in separate files wouldn't be merged?
The text was updated successfully, but these errors were encountered:
Yes this is by design. The reason is because in the first case the only way to make it work the way you want would be to reorder the emitted JS that corresponds to the TS you wrote. This is something we generally try to avoid doing for a few reasons. More problematic than any philosophical concerns about rewriting emit is the difficulty in actually doing this rewriting correctly. There're all kinds of code patterns you could've used between these two modules which are far more complicated than the case you have here (which is essentially the simplest possible case). Your workaround is the only real solution right now, but what you probably want is an internal kind of modifier like #892
Hello, is it intended behavior for this to happen:
which compiles to:
Note that this is a module that takes place in two separate files. I am attempting to access a method of x from a file where x was not specifically declared, but it was declared for the module.
If you combine File 1 and File 2 to get something like this:
which compiles to:
everything works fine. The only solution I have found was to export the variable in the first file. However, the reason I'm not exporting it already is because I don't want the variable to visible outside the module.
Could someone explain why two modules in separate files wouldn't be merged?
The text was updated successfully, but these errors were encountered: