MVCoconut / coconut.ui

Wow, such reactive view! Much awesome!
The Unlicense
89 stars 9 forks source link

Weird stackoverflow #44

Closed kevinresol closed 4 years ago

kevinresol commented 4 years ago
using tink.CoreApi;

class Main extends coconut.ui.View {
    @:attr var item:ItemData;
    function render() '
        <div>
            <div>
                <div>
                    <div>
                        <switch ${item.data}>
                            <case ${Loading}>
                            <case ${Done(data)}>
                                <div>
                                    <div>
                                        <div>
                                            <div>
                                                <a>${data.user}</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <case ${Failed(e)}>
                        </switch>
                    </div>
                </div>
            </div>
        </div>
    ';
    public static function main() {}
}

typedef ItemResponse = {
    final user:SimpleUserResponse;
}

typedef SimpleUserResponse = {
    final id:String;
    final name:String;
}

class ItemData implements coconut.data.Model {
    @:loaded var data:ItemResponse = null;
}

Somehow this requires a somewhat deep html hierarchy to reproduce. (try removing one div wrapper and it will behave correctly)

back2dos commented 4 years ago

Perhaps you're actually running out of stack space? Try -D eval_call_stack_depth=2000 to see if its that has any effect (besides generating a longer stack trace :D).

kevinresol commented 4 years ago

Try -D eval_call_stack_depth=2000

hmmm, doesn't work

back2dos commented 4 years ago

Hmm, apparently this has solved itself or something. Otherwise, please turn Issue44.hx into a compiler error ;)