yishayw edited a comment on issue #92: Vector.<A>.removeAt does not return 
object of type A 
URL: https://github.com/apache/royale-compiler/issues/92#issuecomment-516316417
 
 
   Sorry for the laconic title and description. The description should be:
   
   When compiling 
   ```
   
   var vector:Vector.<A> = new Vector.<A>();
   vector.push(new A());
   var a:A = vector.removeAt(0);
   
   ```
   I get a compile time error: implicit coercion of object of type Object to A
   
   In other words, the compiler thinks `Vector.<A>.removeAt()` returns an 
Object, rather than an A.
   
   Issue #91 is different in that it's a runtime error, and the returned object 
is actually an Array. I would only be able to get to that error by changing the 
third line in the above snippet to
   
   `var a:A = vector.removeAt(0) as A;`
   
   I hope that makes it clearer.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to