Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptbranded nominal typingSingle-choice MCQ

Why does `m` compile but `ft` fails, given the two 'brand' styles below?

type Flavor<T, F> = T & { _flavor?: F }; type Meters = Flavor<number, "Meters">; const m: Meters = 5; type Brand<T, F> = T & { _brand: F }; type Feet = Brand<number, "Feet">; const ft: Feet = 5;