Skip to content

Question about change of type relations rules in regards to index signatures #4651

Closed
@osdm

Description

@osdm

From 1.6 spec, rules about subtypes/supertypes:

  • M is a string index signature of type U, and U is the Any type or S has an apparent string
    index signature of a type that is a subtype of U.
  • M is a numeric index signature of type U, and U is the Any type or S has an apparent
    string or numeric index signature of a type that is a subtype of U.

"U is the Any type or " was added here. But similar rules for assignability weren't changed. That is strange: until 1.6 assignability rules were more relaxed than subtyping rules. What is the rationale for that? Thanks!

Metadata

Metadata

Assignees

Labels

SpecIssues related to the TypeScript language specification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions