Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptstructural typing unsoundnessSingle-choice MCQ

Comparing two object types whose properties are themselves functions, TypeScript's `--strictFunctionTypes` enforces contravariant parameter checking for standalone function-typed properties but NOT for properties written with method shorthand. What is the deep reason the compiler deliberately keeps method parameters bivariant?

interface A { handler(x: string | number): void; } // method shorthand interface B { handler: (x: string | number) => void; } // property