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

Assert substitute type #37

Closed
antongolub opened this issue Aug 27, 2019 · 1 comment
Closed

Assert substitute type #37

antongolub opened this issue Aug 27, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@antongolub
Copy link
Member

const decorator = constructDecorator(
          (targetType: unknown, target: any, age: number) => {
            if (targetType === CLASS) {
              return 'foo'
            }
            return
          },
        )

        @decorator(100)
        class Foo {
        }

should throw something like

new Error('Decorator: class decorator should return a class')
@antongolub antongolub added the enhancement New feature or request label Aug 27, 2019
@antongolub
Copy link
Member Author

This happens at runtime, so let the engine handle it.

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

No branches or pull requests

1 participant