Skip to content

TS 4.2: Type alias differs from original typeΒ #44119

Closed
@YauheniKhadanionak

Description

@YauheniKhadanionak

Bug Report

πŸ”Ž Search Terms

4.2 Type alias

πŸ•— Version & Regression Information

  • This changed between versions 4.1.5 and 4.2.3
  • Also reproducible in 4.3.0-beta and nightly

⏯ Playground Link

Playground link

πŸ’» Code

const func1 = (arg: Record<'field', string>) => { }

type Type1 = Record<'field', string>
const func2 = (arg: Type1) => { }

const arg: Record<string, string> = {}

func1(arg) // ok
func2(arg) // Property 'field' is missing in type 'Record<string, string>' but required in type 'Type1'.

πŸ™ Actual behavior

Type alias Type1 differs from original type Record<'field', string>

πŸ™‚ Expected behavior

Types of func1 and func2 should be equal and behave the same way, as it worked on 4.1.5 and earlier

Metadata

Metadata

Assignees

Labels

DuplicateAn existing issue was already created

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions