Ticket Created

CIQQA-1382

New compiler crashes on "me"

    class Settings {
        var layout as Number = 0;

        function setLayout(i as Number) as Void {
            me.layout = i;
        }
    }

ERROR: approachs60: Could not validate optimized Monkey C IR.
ERROR: approachs60: bug.mc:5: Optimization validation failure: Cannot find register value '%me'

The same code works if you change "me" to self, or drop it entirely.

Parents
  • me is an alternative name for self. see Accessing Class Members

    I don't actually use it, but I run all the open source projects I can (mostly from here) through my optimizer to make sure that the optimizer doesn't crash, and that the optimized code still compiles (I also manually test a few of them, but there are too many to do more than a compilation check). A bunch of them stopped building due to this. And the keywords are still documented as equivalent, with no indication that "me" is deprecated.

    My solution for now is to just spit out self instead of me in the optimized code. I may put that into the code formatter, rather than the optimizer if it turns out they really mean to kill it...

Comment
  • me is an alternative name for self. see Accessing Class Members

    I don't actually use it, but I run all the open source projects I can (mostly from here) through my optimizer to make sure that the optimizer doesn't crash, and that the optimized code still compiles (I also manually test a few of them, but there are too many to do more than a compilation check). A bunch of them stopped building due to this. And the keywords are still documented as equivalent, with no indication that "me" is deprecated.

    My solution for now is to just spit out self instead of me in the optimized code. I may put that into the code formatter, rather than the optimizer if it turns out they really mean to kill it...

Children
No Data