Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'inherited' does not exist on type <...> #144

Open
remag9330 opened this issue Jan 31, 2018 · 1 comment
Open

Property 'inherited' does not exist on type <...> #144

remag9330 opened this issue Jan 31, 2018 · 1 comment

Comments

@remag9330
Copy link

Hi,

I'm looking into seeing if I can convert an existing Dojo project to TypeScript using these typings and I'm having trouble calling this.inherited(arguments) in classes that I am declaring.

To reproduce, simply add the following to the Dialog class definition in the example/basicApp project:

    destroy() {
        this.inherited(arguments);
    }

which gives the error "src/app/Dialog.ts(24,8): error TS2339: Property 'inherited' does not exist on type 'Dialog'" rather than just working.

Is there a different way to call the base classes method from an inheriting class? I can't seem to find any references of how to do this in the repository.

tsc --version
Version 2.6.2

Thanks in advance

@remag9330 remag9330 changed the title Property 'inherited' does not exist on type ... Property 'inherited' does not exist on type <...> Feb 1, 2018
@remag9330
Copy link
Author

I had some time to look into this today, and it makes sense that currently decorators cannot alter the supplied class as the class has to exist before being passed in to the decorator function. See microsoft/TypeScript#4881 for a relevant typescript request on mutating decorators.

In the meantime I've just added dojo._base.DeclareCreatedObject to the interface declaration of my classes as a hacky workaround to gain access to this.inherited functions, which works but I'm not happy with it. Still open for any better suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant