Tighter parameter decorator checking with --experimentalDecorators · Issue #52435 · microsoft/TypeScript (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@DanielRosenwasser

Description

@DanielRosenwasser

// @experimentalDecorators: true export declare const Inject: (entity: Function, dataSource?: string) => (target: object, key: string | symbol, index?: number) => void;

export class Foo {}

export class C { constructor(@Inject(Foo) x: any) { } }

Previously: no error
In main/5.0:

Unable to resolve signature of parameter decorator when called as an expression.
  Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'