-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: DecoratorsThe issue relates to the decorator syntaxThe issue relates to the decorator syntaxFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
I couldn't find any documentation on this breaking change between TS 2.3.4 and TS 2.4.0.
I'm not sure whether this is a bug or simply an undocumented change. I suspect the latter--in which case my suggestion is to add documentation regarding that change.
TypeScript Version: >= 2.4.0
Ran tsc with flags --experimentalDecorators --emitDecoratorMetadata.
Using reflect-metadata v0.1.10
Code
import 'reflect-metadata'
const dec = (obj: {}, prop: string) => undefined
class Foo {
@dec public foo: string | null // seems to happen with any complex type
@dec public bar: string
}
console.log(Reflect.getMetadata('design:type', Foo.prototype, 'foo'))
console.log(Reflect.getMetadata('design:type', Foo.prototype, 'bar'))Expected behavior:
output in 2.3.4:
[Function: String]
[Function: String]
Actual behavior:
output in 2.4.0:
[Function: Object]
[Function: String]
awendland and ulrichb
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: DecoratorsThe issue relates to the decorator syntaxThe issue relates to the decorator syntaxFixedA PR has been merged for this issueA PR has been merged for this issue