JSMonk / hegel

An advanced static type checker
https://hegel.js.org
MIT License
2.1k stars 59 forks source link

Maximum stack when inferring classes with a method that calls another method #377

Open kevinbarabash opened 1 year ago

kevinbarabash commented 1 year ago

Playground link: https://hegel.js.org/try#MYGwhgzhAEBiD29oG8BQ0PQEZgE4AowAabAShXUytwFMAXAV1wDtoBZMOgCwDpcxmAE3gBbfOQB80AAw8ArNAD80MNABc2ANyUMAX1Q7sYAF6ESWcmirV6TVtwCWEHjgLEy2qvt1A

class Foo {
    bar(a, b) {
        return Math.random() > 0.5 ? a : b;
    }

    baz(a, b) {
        return this.bar(a, b);
    }
}