royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spiros Aggelopoulos" <aggelopou...@novusnet.eu>
Subject Compiler error using static function toString
Date Fri, 04 May 2018 13:13:15 GMT
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 












Mime
View raw message