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]
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
Expected behavior:
output in 2.3.4:
Actual behavior:
output in 2.4.0: