# Kotlin Contracts

DevFeed: [Kotlin Contracts](<https://devfeed.tech/articles/kotlin-contracts-39198.md>)

Original publisher: [Read original article](<https://kt.academy/article/ak-contracts>)

Published: 2023-07-03T00:15:00Z

Content type: tutorial

Language: en

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

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [practical](<https://devfeed.tech/tags/practical.md>), [programming](<https://devfeed.tech/tags/programming.md>), [review](<https://devfeed.tech/tags/review.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This article explains Kotlin Contracts, including how their DSL definitions communicate conditions and invocation behavior to the Kotlin compiler. It describes how contracts support features such as smart-casting and improved compiler understanding while being removed through inline expansion during compilation.

## Source excerpt

Practical review of Kotlin Contracts - a feature we often use, without knowing about it.