Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptpolymorphic thisSingle-choice MCQ

Why does assigning a `Sub` instance to a variable annotated with a method that returns the polymorphic `this` type sometimes break structural assignability in the direction shown?

class Animal { clone(): this { return this; } } class Dog extends Animal { bark() {} } let a: Animal = new Dog(); const c = a.clone(); c; // type?