#keyof intersection types not showing auto completes

1 messages · Page 1 of 1 (latest)

lofty tangle
#

hi i have this code

type TypeOne = {name: string}
type TypeTwo = {age: number}

type Merged = TypeOne & TypeTwo

type DataType = {bio: keyof Merged}
const data: DataType = {bio: ''} // no autocomplete here

theres no error and everthing is fine when i do this but somehow the autocomplete doesnt work, any clue ? thanks!

fleet venture
#

it works in the playground

crimson raftBOT
#
krofdrakula#6425

Preview:```ts
type TypeOne = {name: string}
type TypeTwo = {age: number}

type Merged = TypeOne & TypeTwo

type DataType = {bio: keyof Merged}
const data: DataType = {bio: ""}```

fleet venture
#

the error shows for the bio property name, and it offers to autocomplete "name" | "age" as expected

lofty tangle
#

anw its resolved now and i understand why, thank you for answering pepechristmas