fdorg / flashdevelop

FlashDevelop is a free and open source code editor.
MIT License
818 stars 219 forks source link

Possible Stack Overflow Exception #3253

Open markknol opened 3 years ago

markknol commented 3 years ago

Debug information:

Possible Stack Overflow Exception in C:\xxxxxxxx\application\com\game\Game.hx
Please contact the developers via https://github.com/fdorg/flashdevelop/issues/new
Debug information:
CodeComplete.InferType({20:         var marginX = 10;})

The code:

package com.game;

import com.ui.buttons.PrimaryButton;
import flambe.Entity;
import flambe.util.Value;
import temple.components.display.ValueTextComponent;
import temple.components.pointer.PointerTap;

/**
 * @author Mark Knol
 */
class Game extends AbstractGame {
    private var _data:Array<Value<Int>>;

    function createUI() {
        _data = [for (idx in 0...4) {
            var value = new Value(0);

            var marginY = 200;
            var marginX = 10;
            var size = 75;
            var distance = 125;
            containers.ui.add(new Entity().add([
                new PrimaryButton("<", size, size)
                    .setXY(marginX, marginY + idx * distance),
                new PointerTap(e -> value._ --),
            ]));
            containers.ui.add(new Entity().add([
                new PrimaryButton("<", size, size)
                    .setXY(marginX, marginY + idx * distance),
                new PointerTap(e -> value._ --),
            ]));
            containers.ui.add(new Entity().add([
                new ValueTextComponent(value)
                    .setXY(marginX + size + marginX, marginY + idx * distance),
            ]));

            value;
        }];
    }
}

I'm using HaxeDevelop from this build http://www.github.com/fdorg/flashdevelop/commit/0592402cd4