This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline var area: Area // inline property - cannot have backing field | |
get() = ... | |
set(value) { ... } | |
var area: Area // inline getter and/or setter | |
get() = ... | |
inline set(value) { ... } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var12 = ((Inline.Companion)this).filterNotInline((Iterable)list, (Function1)null.INSTANCE); | |
System.out.println(var12); // print result of .filterNotInline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// list setup occurs before this | |
while(var6.hasNext()) { // do filtering, inlined | |
Object element$iv$iv = var6.next(); | |
if (element$iv$iv instanceof Character) { | |
destination$iv$iv.add(element$iv$iv); | |
} | |
} | |
List var12 = (List)destination$iv$iv; | |
System.out.println(var12); // print result of .filter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val list = listOf('a', 1) // list with a Char and an Int | |
// both print 'a' | |
println(list.filter( { it is Char} )) // inline call site | |
println(list.filterNotInline( { it is Char} )) // not-inline call site | |
// copy of library function with inline keyword removed | |
fun <T> Iterable<T>.filterNotInline(predicate: (T) -> Boolean): List<T> { | |
return filterTo(ArrayList<T>(), predicate) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun foo(...) = { ... } |