nominal typing

A type system in which two types are compatible only if one is declared to inherit or implement the other, not merely because they have the same members.

In more detail

Under nominal rules, two classes with identical members are still unrelated types. Languages such as C# and Java are nominal, while TypeScript compares shapes and is structural.

Related terms

Taught in

References