apache / apache/royale-asjs

Compiller Error 1137: Calling Static ToString Function from another class

Open
#223 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
ActionScript
Stars
380
Forks
120
PR merge metrics
No merged PRs in 30d

Description

test case:
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");
}
}
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by compiling the two ActionScript classes shown in the issue and confirm the 1137 error on the static ToStringImp.toString call. Trace how the compiler resolves that call versus the overridden CompError.toString method; done means the testcase compiles and returns the supplied string.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.