# Type Parameter Constraint

DevFeed: [Type Parameter Constraint](<https://devfeed.tech/articles/type-parameter-constraint-25025.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/type-parameter-constraint/>)

Author: author@typealias.com (Dave Leeds)

Published: 2017-09-30T01:54:04Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Type Parameter](<https://devfeed.tech/topics/type-parameter.md>), [Type Argument](<https://devfeed.tech/topics/type-argument.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>)

Tags: [constraint](<https://devfeed.tech/tags/constraint.md>), [generic](<https://devfeed.tech/tags/generic.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [type-parameter](<https://devfeed.tech/tags/type-parameter.md>), [variance](<https://devfeed.tech/tags/variance.md>)

## AI overview

Kotlin type parameter constraints restrict accepted type arguments to an upper bound while preserving access to that type's functions and properties. Constraints can be written in the type parameter declaration or, in a more verbose form, after the return type. Both forms support constraints on multiple parameters; the verbose form also allows one parameter to have multiple constraints, so a type must satisfy each bound.

## Source excerpt

Overview Type parameter constraints allow you to limit the types that can be accepted as a type argument to an upper bound, giving you the ability to invoke functions and properties on an object while preserving the type. If that sounds confusing, go check out the guide, When to Use Type Parameter Constraints, which walks through the use cases in more detail. In this article, we're going to look at the variety of ways that you can create a type parameter constraint in Kotlin.