Skip to content

'as' cast followed by comment errors #344

Description

@TannerRogalsky

as3 code for example:

package {
    public class Issue {
        public function Issue() {
            var string:String/*test*/ = "";

            var o:Object = [1, 2, 3];
            var a:Array = o as Array/*test*/;
        }
    }
}

expected result

class Issue
{
    public function new()
    {
        var string : String = "";
        
        var o : Dynamic = [1, 2, 3];
        var a : Array<Dynamic> = try cast(o, Array</*AS3HX WARNING no type*/>) catch(e:Dynamic) null;
    }
}

actual result

class Issue
{
    public function new()
    {
        var string : String = "";
        
        var o : Dynamic = [1, 2, 3];
        var a : Array<Dynamic> = 

with error

Called from ? line 1
Called from Run.hx line 110
Called from Run.hx line 63
Called from as3hx/Writer.hx line 3635
Called from as3hx/Writer.hx line 253
Called from as3hx/Writer.hx line 260
Called from as3hx/Writer.hx line 329
Called from as3hx/Writer.hx line 462
Called from as3hx/Writer.hx line 606
Called from as3hx/Writer.hx line 858
Called from as3hx/Writer.hx line 1194
Called from as3hx/Writer.hx line 1521
Called from as3hx/Writer.hx line 1473
Called from as3hx/Writer.hx line 1192
Called from as3hx/Writer.hx line 1189
Called from as3hx/Writer.hx line 1196
Called from as3hx/Writer.hx line 2230
Uncaught exception - Unexpected ECommented(/*test*/,true,true,EIdent(Array))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions