Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptdeclaration mergingSingle-choice MCQ

Two interface declarations of the same name merge, and each declares a property `id` with a DIFFERENT primitive type. What does the compiler actually do, and how does this differ from merging two method (call-signature-bearing) declarations of the same name?

interface Box { id: string; } interface Box { id: number; } // line A interface Api { fn(x: string): void; } interface Api { fn(x: number): void; } // line B