Synthetic extensions wins against top-level extension.

This commit is contained in:
Stanislav Erokhin
2015-12-18 15:23:11 +03:00
parent e8a697cb6d
commit 1574dc78df
16 changed files with 189 additions and 45 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ class FilesTest {
createTempFile("temp3", ".kt", dir)
// This line works only with Kotlin File.listFiles(filter)
val result = dir.listFiles { it.getName().endsWith(".kt") }
val result = dir.listFiles { it -> it.getName().endsWith(".kt") } // todo ambiguity on SAM
assertEquals(2, result!!.size)
// This line works both with Kotlin File.listFiles(filter) and the same Java function because of SAM
val result2 = dir.listFiles { it -> it.getName().endsWith(".kt") }