Knowledge · frontend

TypeScript Variance — Covariance and Contravariance

The rules that decide whether Dog[] and (x: Dog) => void inherit the Dog-is-an-Animal relationship, and in which direction — plus why method shorthand syntax leaves a hole even with strictFunctionTypes on

Date
2026-08-23
Reading time
8 min
Confidence
Inferred

This page is a machine translation of the Korean original. Read the original

Document graph

Related documents

Documents that mention this

Related Knowledge

Tags

typescriptvariancecovariancecontravariancetype-safety