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
This commit is contained in:
Nathan Shively-Sanders
2021-04-26 09:19:24 -07:00
committed by GitHub
parent b9c1e98544
commit d5af89c552
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
// @noEmit: true
// @checkJs: true
// @filename: typeTagOnPropertyAssignment.js
const o = {
/**
* @type {"a"}
*/
a: "a",
/** @type {() => 'b'} */
n: () => 'b'
};
o.a
o.n