joshtynjala commented on issue #207:
URL: 
https://github.com/apache/royale-compiler/issues/207#issuecomment-1015823549


   This is definitely something I have always wanted to see in AS3.
   
   If this were to be implemented, one thing that should be allowed is 
something like this:
   
   ```as3
   var fun:Function.<(ev:Event):void> = function(ev:Object):void {};
   ```
   
   To be clear, Event is a subclass of Object, so that function should be 
allowed for the same reason why you can assign an `Event` instance to a 
variable of type `Object`.
   
   ```as3
   var obj:Object = new Event();
   ```
   
   With return types, there's a similar situation, but instead of superclasses, 
subclasses would be allowed.
   
   ```
   var fun:Function.<():Object> = function():Event {}
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to