Yes,
 if I rename the static function to "toStringSome" the compiler stop to 
complain about that.
 
-Spiros

-----Original Message-----
From: Alex Harui [mailto:aha...@adobe.com.INVALID] 
Sent: Friday, May 4, 2018 7:48 PM
To: dev@royale.apache.org
Subject: Re: Compiler error using static function toString

Hmm.  I agree that doesn't make sense.  Try changing the name of the function 
just to see if there is sensitivity to the "toString".  "toString" is handled 
in a strange way in AS.

-Alex

On 5/4/18, 6:13 AM, "Spiros Aggelopoulos" <aggelopou...@novusnet.eu> wrote:

    Hi , 
    there is a compiler error on the code bellow, 
    is any reason to avoid this type of code? Or it is a bug ?
    
    
    
    package org.comp
    {
        public class ToStringImp
        {
                public static function toString(str:String):String
                {
                        return str;
                }
        }
    }
    
    
    package org.comp
    {
        import org.apache.royale.events.EventDispatcher;
        import org.apache.royale.events.IEventDispatcher;
        
        public class CompError extends EventDispatcher
        {
                public function CompError(target:IEventDispatcher=null)
                {
                        super(target);
                }
                
                override public function toString():String
                {
                        
                        //compiler message : 
                        //1137: Incorrect number of arguments.  Expected no
    more than 0 
                        return ToStringImp.toString("some string value");
                }
        }
    }
    
    Thanks , 
    
    Spiros 
    
    
    
    
    
    
    
    
    
    
    
    


Reply via email to