03653934c3
Previously, getWidenedTypedFromJSPropertyAssignment was not called for Typescript code. Since property assignments on functions, it is. That meant that property assignments would incorrectly create a JS container for empty object literals in a property assignment, even in Typescript: ```ts const one = () => 1 one.p = {} one.p.q = {} // should not work in Typescript! ``` Now empty object literals never create expando objects in Typescript, because getJSExpandoObjectType requires the declaration to be in a JS file.
8 lines
182 B
TypeScript
8 lines
182 B
TypeScript
interface Combo {
|
|
(): number;
|
|
p?: { [s: string]: number };
|
|
}
|
|
const c: Combo = () => 1
|
|
// should not be an expando object, but contextually typed by Combo.p
|
|
c.p = {}
|
|
|