Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftmetatype and runtime metadataSingle-choice MCQ

Given `type(of:)` on a value of a class type that has subclasses, and a separate static call `T.self`, how do these two metatype lookups differ at runtime?

class Animal {} class Dog: Animal {} let a: Animal = Dog() print(type(of: a)) // ? print(Animal.self) // ?