TypeScript/tests/baselines/reference/typeTagOnPropertyAssignment.types
Nathan Shively-Sanders d5af89c552
Contextual typing checks property assignments for type annotation (#43598)
Property assignments can have a type annotation in JS. This PR adds a
check for it in contextual typing.

Fixes #43379
2021-04-26 09:19:24 -07:00

30 lines
552 B
Plaintext

=== tests/cases/conformance/jsdoc/typeTagOnPropertyAssignment.js ===
const o = {
>o : { a: "a"; n: () => 'b'; }
>{ /** * @type {"a"} */ a: "a", /** @type {() => 'b'} */ n: () => 'b'} : { a: "a"; n: () => 'b'; }
/**
* @type {"a"}
*/
a: "a",
>a : "a"
>"a" : "a"
/** @type {() => 'b'} */
n: () => 'b'
>n : () => 'b'
>() => 'b' : () => 'b'
>'b' : "b"
};
o.a
>o.a : "a"
>o : { a: "a"; n: () => "b"; }
>a : "a"
o.n
>o.n : () => "b"
>o : { a: "a"; n: () => "b"; }
>n : () => "b"