JSMonk / hegel

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

Fluent interfaces do not work #111

Open srg-kostyrko opened 4 years ago

srg-kostyrko commented 4 years ago

https://jsmonk.github.io/hegel/try#MYGwhgzhAEBCkEtgGEwmAV3AFwPYCdoBvAKGnOgDc0MBTALmgDsMBbAI1sIF5oAGANwkyFYLiYRs+DMDz4AFNRB1ovPgEpiIihWwALBBAB0Slb1O0hOgL7bomfPlpNsANRq156xiw5ctOjpO2Bj4TND6hiYeVhS2OmAAJonyuAAOXGBMiT5snPiapIG6BsYW0ADUvOmZ2bHFwaHhkRD10La2JKCQMADKwAjO2AgAZkio6FhgctC0AB7Yzokw8BDjaJg4BAH24pLSsgSKHqr8hXYQGBkKFuqx8dBrTF475C3RyrSnALLTekZPeTvW5tRphCKle4kTpiCTYaCJU5MWgAd2g-UGLlG60mWwUACZ1CIjEkUgBGInkAEIZ6U6BGBxOFzuT5eARAA

if a method returns this - it is inferred as the class where a method was defined, and this will break chaining if used with child class. typescript has special type this that is polymorphic and solves this issues it would be great if hegel would correctly infer this for such cases

JSMonk commented 4 years ago

Oh, thank you. It's an important thing. We will fix it soon. Thank you a lot for your contribution ^_^.