You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/11/22 15:58:46 UTC

[GitHub] [royale-asjs] estanglerbm opened a new issue #946: Compiler gets internal error on * in some contexts

estanglerbm opened a new issue #946:
URL: https://github.com/apache/royale-asjs/issues/946


   This line (from existing Flex project):
   
   
   						var resp : XMLList = XMLList( evt.result.*::response );
   
   
   causes this compiler error:
   
   
   didn't find CompilationUnit for *
   Could not find file for class: *
   Error: File not found: *
   
   
   Internal error: java.lang.RuntimeException: Unable to find JavaScript filePath for class: * org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:779)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:808)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:808)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:808)org.apache.royale.compiler.internal.graph.GoogDepsWriter.buildDB(GoogDepsWriter.java:468)org.apache.royale.compiler.internal.graph.GoogDepsWriter.getListOfFiles(GoogDepsWriter.java:115)org.apache.royale.compiler.internal.codegen.mxml.royale.MXMLRoyalePublisher.publish(MXMLRoyalePublisher.java:471)org.apache.royale.compiler.clients.MXMLJSCRoyale.compile(MXMLJSCRoyale.java:442)org.apache.royale.compiler.clients.MXMLJSCRoyale._mainNoExit(MXMLJSCRoyale.java:259)org.apache.royale.compiler.clients.MXMLJSCRoyale.mainNoExit(MXMLJSCRoyale.java:216)or
 g.apache.royale.compiler.clients.MXMLJSC._mainNoExit(MXMLJSC.java:363)org.apache.royale.compiler.clients.MXMLJSC.mainNoExit(MXMLJSC.java:298)org.apache.royale.compiler.clients.MXMLJSC.staticMainNoExit(MXMLJSC.java:256)org.apache.royale.compiler.clients.MXMLJSC.main(MXMLJSC.java:238)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-732632280


   I can look into this in a couple of weeks as a compiler issue.
   
   For now, I am hoping we can find a workaround...
   Firstly (and this would be normal, regardless, with Royale because the XML support also relies quite a bit on the compiler 'knowing' that it is XML)
   Can you please check what the type (as the compiler could understand it) of evt.result is.
   
   If it is typed as Object or * (untyped), can you please try using an intermediate variable or in-place casting.
   
   e.g.
   var xml:XML = evt.result as XML;
   var resp : XMLList = XMLList( xml.*::response );
   
   or maybe
   var resp : XMLList = XMLList(XML(evt.result).*::response );
   
   This response e4x query is a 'multi-QName' lookup iirc, and I think I did something to get that working in the past for a client project, but I didn't see any unit tests that I added for that specifically, so I can't say for sure it will work, but hopefully it might (fingers crossed).
   
   Let me know how you get on....


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] joshtynjala commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
joshtynjala commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-736825169


   ```
   evt.result.*::response
   ```
   
   I've never seen namespace syntax used this way. Can `*` be used as wildcard in E4X to get the child with that name from any namespace?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] estanglerbm commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
estanglerbm commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-733405429


   "evt" is a mx.rpc.events.ResultEvent, so "evt.result" is declared Object but, with e4x, is an XMLList, I believe.  It's the result of an HTTPService request.  (The XML has <response>...</response>.)
   
   I'll try the possible workarounds.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-733165900


   Fwiw, I just quickly tested SWF and JS for the following:
   ```
   var xml:XML = <xml xmlns:cat="cat" xmlns:dog="dog"><cat:response value="cat"/><dog:response value="dog"/><response value="unspaced"/></xml>
   
   var list:XMLList = xml.*::response;
   ```
   
   The above gives consistent results between the two. But I was not able to repro that compiler error yet. Hopefully you can get whatever you need working. I will assign this task to myself, but will not get to it for a while, I am afraid.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] estanglerbm commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
estanglerbm commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-735496805


   Yes, putting XMLList around "result" is a workaround for the compiler error:
   
   `var resp : XMLList = XMLList( (evt.result as XMLList).*::response );`
   or
   `var resp : XMLList = XMLList( XMLList(evt.result).*::response );`
   
   Attached is a simple test case showing the compiler error.
   [TestCompilerStarError.mxml.txt](https://github.com/apache/royale-asjs/files/5613312/TestCompilerStarError.mxml.txt)
   
   The issue is doing:  Object.*


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] greg-dove commented on issue #946: Compiler gets internal error on * in some contexts

Posted by GitBox <gi...@apache.org>.
greg-dove commented on issue #946:
URL: https://github.com/apache/royale-asjs/issues/946#issuecomment-736837615


   > can * be used as wildcard in E4X to get the child with that name from any namespace?
   
   Yes this is how it works. I think I added unit tests to cover this case.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org