Skip to content

From TS's perspective, there's no difference between this code and #170608

@Fgu67

Description

@Fgu67
    From TS's perspective, there's no difference between this code and
const func = (obj1: A[] | B[], obj2: A[] | B[]):void => {
      obj1[0].children.push(obj2[1])
}

which is clearly unsafe. We don't track where objects "came from" to establish higher-order relations.

Originally posted by @RyanCavanaugh in microsoft/TypeScript#52084 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions