# Star-Projections and How They Work

DevFeed: [Star-Projections and How They Work](<https://devfeed.tech/articles/star-projections-and-how-they-work-25043.md>)

Original publisher: [Read original article](<https://typealias.com/guides/star-projections-and-how-they-work/>)

Author: author@typealias.com (Dave Leeds)

Published: 2018-04-05T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [generics](<https://devfeed.tech/topics/generics.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [class](<https://devfeed.tech/tags/class.md>), [function](<https://devfeed.tech/tags/function.md>), [generic](<https://devfeed.tech/tags/generic.md>), [generic-variance](<https://devfeed.tech/tags/generic-variance.md>), [generics](<https://devfeed.tech/tags/generics.md>), [guide](<https://devfeed.tech/tags/guide.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [programming](<https://devfeed.tech/tags/programming.md>), [star-projection](<https://devfeed.tech/tags/star-projection.md>), [type-projection](<https://devfeed.tech/tags/type-projection.md>), [types](<https://devfeed.tech/tags/types.md>), [use-site-variance](<https://devfeed.tech/tags/use-site-variance.md>), [variance](<https://devfeed.tech/tags/variance.md>)

## AI overview

This tutorial explains how Kotlin star-projections work when a function must accept any kind of a generic. It applies subtyping rules for accepted and returned types to compare star-projections with other type-safe solutions.

## Source excerpt

Have you ever wondered how star-projections work? Or why they change your function parameter and return types? Or why it seems like sometimes you can actually get by without them? In the first article in this series, An Illustrated Guide to Covariance and Contravariance in Kotlin, we uncovered two simple, easy-to-understand rules that illuminate variance, and saw how they applied to regular class and interface inheritance in Kotlin. In the second article, The Ins and Outs of Generic Variance in Kotlin, we saw how those same two rules played out for generics, discovering what type projections are and how they work.