Bernhard
10/06/2026, 6:03 PMYoussef Shoaib [MOD]
10/06/2026, 6:06 PMinline fun <reified T> foo() = object: Foo { fun foo(x: Any): Boolean = x is T }
Depending on your build setup, minifiers like R8 can recognize and deduplicate these extra classesBernhard
10/06/2026, 6:06 PMYoussef Shoaib [MOD]
10/06/2026, 6:09 PMYoussef Shoaib [MOD]
10/06/2026, 6:10 PMYoussef Shoaib [MOD]
10/06/2026, 6:13 PMreified magic going onBernhard
10/06/2026, 6:13 PMBernhard
10/06/2026, 6:14 PMYoussef Shoaib [MOD]
10/06/2026, 6:15 PMBernhard
10/06/2026, 6:16 PMYoussef Shoaib [MOD]
10/06/2026, 6:17 PMinline methods short and extract any big logic parts into helpers
For library development, it's important since inline method bodies will be inlined for your consumers, so changing the bodies in a new version won't change the behaviour for already compiled code.