Closed
Description
TypeScript Version: 2.9.1
Search Terms:
flatMap
is:open
Code
type PlainObjectItem = string | number | boolean | null
interface PlainObject {
[key: string]: PlainObjectItem | PlainObjectItem[] | PlainObject
}
const hoge: PlainObject = {
key1: 'hoge',
key2: {
key21: 'aaa',
key22: false,
key23: {
key231: [1,2,3,4,5],
date: new Date()
}
}
}
Expected behavior:
Error message is something like 'new Date()' is not assignable to type 'PlainObjectItem | PlainObjectItem[] | PlainObject'.
Actual behavior:
Property 'flatMap' is missing in type '{ key21: string; key22: false; key23: { key231: number[]; date: Date; }; }'.
(This example says Property 'length' is missing...
)
Related Issues: