[BUG] Nested function call causes fatal error while compiling

Comments

7 comments

  • Martin Enderleit

    I tried this out and I think this might be fixed in the new version they just released, although I am not sure what the getStruct function actually does from your code. I just made it return a struct with a field and a method.

    function getStruct(in) {
    return {
    some_field : 0,
    some_method : function() {
    return 0;
    }
    };
    }
    0
    Comment actions Permalink
  • Anastasia Melnikova

    Sorry, I missed one step in my report: getStruct is also a method of another struct. Still compile error.

    var a = {
    getStruct : function( in ) {
    return {
    some_field : 0,
    some_method : function() {
    return 0;
    }
    }
    }
    }

    abs( a.getStruct( [ ] ).some_field );

    0
    Comment actions Permalink
  • Martin Enderleit

    Hmm... I ran the following code, and it worked fine (no compile errors). Are you sure you have updated to the latest version? :)

    My IDE version is 23.1.1.168 and my Runtime version is 23.1.1.160

    var a = {
    getStruct : function(in) {
    return {
    some_field : -1,
    some_method : function() {
    return -1;
    }
    }
    }
    };

    var actual = abs(a.getStruct([]).some_field);
    var expected = 1;

    if (actual != expected) {
    show_debug_message("FAILED: Actual value does not match Expected value");
    } else {
    show_debug_message("PASSED");
    }
    0
    Comment actions Permalink
  • Anastasia Melnikova

    This is getting more and more interesting:

    show_debug_message( string( a.getStruct([ ]).some_field ) ); // compile failed
    abs(a.getStruct([ ]).some_field); // still failed
    var actual = abs(a.getStruct([ ]).some_field); // works like a charm

    I have no idea what's going on here.

     

    0
    Comment actions Permalink
  • Martin Enderleit

    That is wierd. I guess there is some kind of bug going on here still. Must be some combination of things wrapped in other things that aren't resolving properly.

    0
    Comment actions Permalink
  • YoYo QA Dept

    Hi Anastasia Melnikova,

    Thank you for your feedback.
     
    could I ask you to attach a small sample project which shows exactly what you're doing when you have this issue?

    You can do that by hosting it on a could service (such as Dropbox) and sending us the link here. If you are unable to provide a public link (or you wish your program to remain private) please log a ticket via https://accounts.yoyogames.com/contact-us and link to this forum post.

    Many thanks.

    0
    Comment actions Permalink
  • Anastasia Melnikova

    https://www.dropbox.com/s/y0jq5v0c0qcoyi3/Crash.yyz?dl=0 Well, I literally just pasted the same code from comments here. Please fix this compiler crash.

    0
    Comment actions Permalink

Please sign in to leave a comment.