# subtype

A subtype is a type whose values are constrained to satisfy a condition or predicate.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## The problem of union types for type systems

DevFeed: [The problem of union types for type systems](<https://devfeed.tech/articles/the-problem-of-union-types-for-type-systems-39390.md>)

Original publisher: [Read original article](<https://kt.academy/article/union-types-into>)

Published: 2024-06-10T00:00:00Z

Content type: opinion

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [subtype](<https://devfeed.tech/topics/subtype.md>), [generics](<https://devfeed.tech/topics/generics.md>)

Tags: [generics](<https://devfeed.tech/tags/generics.md>), [inference](<https://devfeed.tech/tags/inference.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [static](<https://devfeed.tech/tags/static.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains why general union types are difficult to add to Kotlin and other statically typed systems. It discusses ambiguity in subtype relationships and generic type inference, including the claim that inference is NP-hard, then describes Kotlin's proposed limited use of union types for representing errors through rich errors.

### Source excerpt

Why union types are not such a good idea for static type systems.

## Liskov Substitution Principle

DevFeed: [Liskov Substitution Principle](<https://devfeed.tech/articles/liskov-substitution-principle-40710.md>)

Original publisher: [Read original article](<https://radek.io/posts/liskov-substitution-principle/>)

Published: 2011-08-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [coding](<https://devfeed.tech/topics/coding.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [software-design](<https://devfeed.tech/tags/software-design.md>), [solid](<https://devfeed.tech/tags/solid.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [subtype](<https://devfeed.tech/tags/subtype.md>)

### AI overview

This article explains the Liskov Substitution Principle, the L in SOLID object-oriented design. It presents definitions from Barbara Liskov and Jeannette Wing, a formulation by Robert C. Martin, and a Square-Rectangle hierarchy example showing how subtype behavior can violate substitutability.

### Source excerpt

SOLID Object-Oriented Design