<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu" -->

---
title: Features You Waited For So Long in Kotlin | daily.dev
description: Kotlin 2.4.20 introduces allDistinctBy and allEqualBy, experimental standard-library functions that check collection uniqueness or equality without creating...
canonical: https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Features You Waited For So Long in Kotlin | daily.dev
og:description: Kotlin 2.4.20 introduces allDistinctBy and allEqualBy, experimental standard-library functions that check collection uniqueness or equality without creating...
og:url: https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu
og:image: https://api.daily.dev/og/posts/tDM4OvIuU.png
og:image:alt: Features You Waited For So Long in Kotlin
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Features You Waited For So Long in Kotlin

**[ProAndroidDev](https://daily.dev/sources/pand)** · 4 min read · 4 upvotes · 0 comments

## Summary

Kotlin 2.4.20 introduces allDistinctBy and allEqualBy, experimental standard-library functions that check collection uniqueness or equality without creating intermediate sets, short-circuiting on the first mismatch. Kotlin 2.2 introduced context-sensitive resolution experimentally, letting when expressions omit type qualifiers for enum entries and sealed hierarchy members when the compiler can infer the type, though ambiguity risks mean it still requires an opt-in compiler flag.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://proandroiddev.com/features-you-waited-for-so-long-in-kotlin-6c822e9e344a>

## Questions this post answers

### What do allDistinctBy and allEqualBy do in Kotlin 2.4.20?

They are experimental standard-library functions added in Kotlin 2.4.20 for checking collection uniqueness or equality without manual workarounds. allDistinctBy returns false as soon as it finds a duplicate, avoiding a full pass or creating a separate Set, while allEqualBy checks whether all elements produce the same value through a selector. Both work on Iterable, Sequence, and arrays using structural equality, and require opting into @ExperimentalStdlibApi.

_Track new experimental Kotlin stdlib APIs like these on daily.dev before wiring them into production code._

### How does context-sensitive resolution work in Kotlin when expressions?

Introduced experimentally in Kotlin 2.2, context-sensitive resolution lets a when expression reference enum entries, sealed hierarchy members, or object declarations without their type qualifier when the compiler can infer the type from context. For example, when(problem) can match CONNECTION instead of Problem.CONNECTION. It requires the -Xcontext-sensitive-resolution compiler flag and can create ambiguity if another declaration shares the same name.

_Developers experimenting with Kotlin compiler flags can follow feature maturity updates like this on daily.dev._

## Similar posts on daily.dev

- [Kotlin improves compile-time constants](https://daily.dev/posts/kotlin-improves-compile-time-constants-zfuyb4vn7) · InfoWorld · 0 upvotes · 0 comments
- [Kotlin 2.3.0: Nested Type Aliases, Return in Expression Bodies, JDK 25 Support, and More](https://daily.dev/posts/kotlin-2-3-0-nested-type-aliases-return-in-expression-bodies-jdk-25-support-and-more-mpxtmklrx) · SoftwareMill · 1 upvotes · 0 comments
- [5 Kotlin Features Every Android Developer Should Actually Be Using part 2](https://daily.dev/posts/5-kotlin-features-every-android-developer-should-actually-be-using-part-2-z5lxjn1d1) · Medium · 0 upvotes · 0 comments
- [Kotlin Weekly \#498](https://daily.dev/posts/kotlin-weekly-498-yydicmxue) · Kotlin Weekly · 0 upvotes · 0 comments

---

Tags: [#kotlin](https://daily.dev/tags/kotlin), [#compiler](https://daily.dev/tags/compiler)

[View this post on daily.dev](https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Features You Waited For So Long in Kotlin","url":"https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu"},"datePublished":"2026-09-14T06:47:48.719Z","dateModified":"2026-09-14T06:48:10.896Z","description":"Kotlin 2.4.20 introduces allDistinctBy and allEqualBy, experimental standard-library functions that check collection uniqueness or equality without creating...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26c3e9a4f9c302a5d217539d4f301b37?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26c3e9a4f9c302a5d217539d4f301b37?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ProAndroidDev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ProAndroidDev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/656c1eb1f1ef4f91936e86fc16545114","url":"https://daily.dev/sources/pand"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kotlin,compiler","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ProAndroidDev","item":"https://daily.dev/sources/pand"},{"@type":"ListItem","position":3,"name":"Features You Waited For So Long in Kotlin"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/features-you-waited-for-so-long-in-kotlin-tdm4oviuu#faq","mainEntity":[{"@type":"Question","name":"What do allDistinctBy and allEqualBy do in Kotlin 2.4.20?","acceptedAnswer":{"@type":"Answer","text":"They are experimental standard-library functions added in Kotlin 2.4.20 for checking collection uniqueness or equality without manual workarounds. allDistinctBy returns false as soon as it finds a duplicate, avoiding a full pass or creating a separate Set, while allEqualBy checks whether all elements produce the same value through a selector. Both work on Iterable, Sequence, and arrays using structural equality, and require opting into @ExperimentalStdlibApi. Track new experimental Kotlin stdlib APIs like these on daily.dev before wiring them into production code."}},{"@type":"Question","name":"How does context-sensitive resolution work in Kotlin when expressions?","acceptedAnswer":{"@type":"Answer","text":"Introduced experimentally in Kotlin 2.2, context-sensitive resolution lets a when expression reference enum entries, sealed hierarchy members, or object declarations without their type qualifier when the compiler can infer the type from context. For example, when(problem) can match CONNECTION instead of Problem.CONNECTION. It requires the -Xcontext-sensitive-resolution compiler flag and can create ambiguity if another declaration shares the same name. Developers experimenting with Kotlin compiler flags can follow feature maturity updates like this on daily.dev."}}]}
```

