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

Fixed type error in apply-decorators.ts #13100

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nikelborm
Copy link

@nikelborm nikelborm commented Jan 26, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Throws typescript error

Argument of type 'string | symbol | undefined' is not assignable to parameter of type 'string | symbol'.
  Type 'undefined' is not assignable to type 'string | symbol'

Here:
Screenshot from 2024-01-26 04-06-03

Because typescript definitions of Decorator types are as follows:

declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;

What is the new behavior?

Doesn't throw an error
Screenshot from 2024-01-26 03-42-21

Does this PR introduce a breaking change?

  • Yes
  • No

@nikelborm nikelborm marked this pull request as draft January 26, 2024 00:26
@nikelborm nikelborm marked this pull request as ready for review January 26, 2024 00:37
@nikelborm
Copy link
Author

Apply-decorators were introduced here #3113

@nikelborm nikelborm marked this pull request as draft February 10, 2024 17:13
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

Successfully merging this pull request may close these issues.

2 participants