TypeScript Version: 2.1.4
Code
function PropDeco(target: Object, propKey: string | symbol) { }
class Foo {
@PropDeco
public foo = "bar";
}
Expected behavior:
Since the runtime type (constructor reference) of Foo.foo is supposed to be String, the compiler should emit String as the type of Foo.foo, as it does when the property has an explicitly defined type (i.e. foo: string = "bar"):
__metadata("design:type", String)
Actual behavior:
The compiler emits Object as the type of Foo.foo, which I believe is incorrect:
__metadata("design:type", Object)