You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ModernClass cannot override someMethod because of the following error Class 'Destroyable & Omit<{ someProperty: number; someCallback: () => null; someMethod(): void; }, "constructor">' defines instance member property 'someMethod', but extended class 'ModernClass' defines it as instance member function.
π Expected behavior
ModernClass should be able to add an override because someMethod is defined as a method not a property
Additional information about the issue
The issue is coming from the fact that Omit is not respecting the difference between methods and properties on the type passed into it.
π Search Terms
Omit, Method
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.5.3#code/CYUwxgNghgTiAEkoGdnwCImQFxgewE8oAjCBAbwFgAoeO+ABwFdSBLMeUHfAkYALnjE8eMlAB2Abhr1GLCO05ZchABQBKQQDc8rYNOoBfGqCRxEecTngAhFCADC0VIKq164kAHd4GwZm5CEjIDWQZ8bDxsAgYQf2UeYJADQwMTcGhzJFR4ADEoMEiYAng3MPlFHChsRVAAM1ZPAB4nFGQHSwaAc3gQAA9sEHFgNAAlcDwYYCbuRq6AGngJAgA+FdVwqKiYuPhW1A7xbs1SmVkPb18T1QBJK2wJMBAAFR2m6Ni8Ott7feQV+AAMngAHkALasbAtZztTqsBbwADkYEs3CYhUmiJW6lC9FSNGM1BoKPu8AAMiAugUCHZkI4YfAALx5ApFAgAOnqjRAqjK9BJaIxMA0pXghnmZzoyDwYJAAAV8LEYNFBABGABMAGYJe4pTLHFAIBBiAUANaCEWMgHiJhGnWyaWygCyIGwAAs8MA-PAdHpTrrzgB6QMYPDwADK+vdc0lYoJOJoxIZTs9IBg4j+vQGQxG5Mp1Np9La-vKbA4eC0aZgegQjpALvdnu9vuAJfOdGDscJhiAA
π» Code
π Actual behavior
ModernClass
cannot overridesomeMethod
because of the following errorClass 'Destroyable & Omit<{ someProperty: number; someCallback: () => null; someMethod(): void; }, "constructor">' defines instance member property 'someMethod', but extended class 'ModernClass' defines it as instance member function.
π Expected behavior
ModernClass
should be able to add an override becausesomeMethod
is defined as a method not a propertyAdditional information about the issue
The issue is coming from the fact that
Omit
is not respecting the difference between methods and properties on the type passed into it.The text was updated successfully, but these errors were encountered: