Incorrect function type signature for ParameterDecorator #33260
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Milestone
TypeScript Version: 3.7.0-dev.20190905
Search Terms: ParameterDecorator propertyKey
Code
The type
ParameterDecorator
is defined as follows insrc/lib/es5.d.ts
:TypeScript/src/lib/es5.d.ts
Line 1362 in 72bb4c2
However, at runtime, constructor parameter decorators are invoked with
propertyKey
set toundefined
.Consider the following code:
Compile it with
experimentalDecorators
enabled intsconfig.json
.Expected behavior:
Either:
string | symbol | undefined
in thepropertyKey
argumentpropertyKey string
orpropertyKey symbol
at runtimeActual behavior:
undefined
at runtimePlayground Link:
http://www.typescriptlang.org/play/index.html?experimentalDecorators=true#code/GYVwdgxgLglg9mABDMArAptAFASkQbwChFEAndKEUpUSWBZLKAQ1IHMKAuRAeQCMM0ADTESiAA6k449KSgBPANLp53AM5RSKNogA+iNfIC2fOABsRYia2ZGKsgJJgAJugAe3MCBOzRObgBucDDOBKIkEAhq5ugAdGZwbFgA5JLSsgrK8slCiAoycMASUjJySio4ANyiAL6EdYQQZsxqaogAYnBwAEKsYRFRmiDQcKRY4YgAAiiCULgT4iB8ZjAQiGC26Oqa2n4EdXVAA
Related Issues:
The text was updated successfully, but these errors were encountered: