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

Class types are structural by default, but one member kind breaks that. What does the compiler report at the marked assignment?

class A { private x = 1; } class B { private x = 1; } let a: A = new B(); // <-- here