From 572c9e7115eae31256f1580aaad21800a45e1577 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 17 Apr 2019 15:48:06 +0300 Subject: [PATCH] FIR resolve: add test for map and apply --- .../fir/resolve/testData/resolve/stdlib/mapList.kt | 14 ++++++++++++-- .../resolve/testData/resolve/stdlib/mapList.txt | 13 +++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/compiler/fir/resolve/testData/resolve/stdlib/mapList.kt b/compiler/fir/resolve/testData/resolve/stdlib/mapList.kt index c403f81697d..3806600e800 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/mapList.kt +++ b/compiler/fir/resolve/testData/resolve/stdlib/mapList.kt @@ -1,5 +1,15 @@ fun main() { - val x = List(10) { - "number = $it" + val x = emptyList() + + val u = x.map { it + it } + u.applyX { + 1 in this + contains(1) } + +} + + +inline fun T.applyX(block: @ExtensionFunctionType Function1): T { + TODO() } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/stdlib/mapList.txt b/compiler/fir/resolve/testData/resolve/stdlib/mapList.txt index 0e97df86f39..0f58d36bd23 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/mapList.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/mapList.txt @@ -1,7 +1,16 @@ FILE: mapList.kt public final fun main(): R|kotlin/Unit| { - lval x: R|kotlin/collections/List| = R|kotlin/collections/List|(Int(10), = List@fun (it: R|kotlin/Int|): R|kotlin/String| { - (String(number = ), R|/it|) + lval x: R|kotlin/collections/List| = R|kotlin/collections/emptyList|() + lval u: R|kotlin/collections/List| = R|/x|.R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { + R|/it|.R|kotlin/Int.plus|(R|/it|) + } + ) + R|/u|.R|/applyX||>( = applyX@fun R|kotlin/collections/List|.(it: R|kotlin/collections/List|): R|kotlin/Unit| { + this#.R|FakeOverride|(Int(1)) + R|FakeOverride|(Int(1)) } ) } + public final inline fun R|T|.applyX(block: @R|kotlin/ExtensionFunctionType|() R|kotlin/Function1|): R|T| { + R|kotlin/TODO|() + }