PlayScriptRedux / playscript

PlayScript is an ActionScript compatible compiler and Flash compatible runtime that runs in the Mono/.NET environment
Other
17 stars 9 forks source link

Functions within Functions - Error CS0584: Internal compiler error: #113

Open sushihangover opened 8 years ago

sushihangover commented 8 years ago

Related: #112

Error CS0584: Internal compiler error: Expression `Mono.CSharp.LocalVariableReference' didn't set its type in DoResolve (CS0584) (functionOfFunctions)

Valid ActionScript:

package
{
    import flash.display.Sprite;
    import flash.events.Event;

    public class MainClass
    {
        public static function Main():void
        {
            var sprite:Sprite = new Sprite();
            sprite.addEventListener("myEvent",
                function(e:Event) : void
                {
                    trace("myEvent");
                    step1();
                });
            sprite.dispatchEvent( new Event("myEvent", true ) );

            function step1():void {
                trace("step1");
                step2();
            }
            function step2():void {
                trace("step2");
            }
        }
    }
}

Output:

[trace] myEvent
[trace] step1
[trace] step2

Found : Starling core/Starling.as

    private function requestContext3D(stage3D:Stage3D, renderMode:String, profile:Object):void