mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
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:
committed by
GitHub
parent
b9c1e98544
commit
d5af89c552
13
tests/cases/conformance/jsdoc/typeTagOnPropertyAssignment.ts
Normal file
13
tests/cases/conformance/jsdoc/typeTagOnPropertyAssignment.ts
Normal 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
|
||||
Reference in New Issue
Block a user