#keyof intersection types not showing auto completes
1 messages · Page 1 of 1 (latest)
it works in the playground
Preview:```ts
type TypeOne = {name: string}
type TypeTwo = {age: number}
type Merged = TypeOne & TypeTwo
type DataType = {bio: keyof Merged}
const data: DataType = {bio: ""}```
You can choose specific lines to embed by selecting them before copying the link.
the error shows for the bio property name, and it offers to autocomplete "name" | "age" as expected
ah i just realized in the realcode im putting extra types identifier for discriminated union and it make the autocomplete not working
type TypeOne = {step: 1,name: string}
type TypeTwo = {step: 2,age: number}
type Merged = TypeOne & TypeTwo
type DataType = {bio: keyof Merged}
const data: DataType = {bio: ''}```
anw its resolved now and i understand why, thank you for answering 