From 27ab643d3fb3f3e7d0acb8f3a3d23c3dcc9360e0 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 22 Sep 2015 16:05:54 +0300 Subject: [PATCH] Move `to` method to Tuples --- libraries/stdlib/src/kotlin/util/Standard.kt | 7 ------- libraries/stdlib/src/kotlin/util/Tuples.kt | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libraries/stdlib/src/kotlin/util/Standard.kt b/libraries/stdlib/src/kotlin/util/Standard.kt index 7ad93e9418b..f8bd255ac69 100644 --- a/libraries/stdlib/src/kotlin/util/Standard.kt +++ b/libraries/stdlib/src/kotlin/util/Standard.kt @@ -18,13 +18,6 @@ public fun TODO(): Nothing = throw NotImplementedError() public fun TODO(reason: String): Nothing = throw NotImplementedError("An operation is not implemented: $reason") -/** - * Creates a tuple of type [Pair] from this and [that]. - * - * This can be useful for creating [Map] literals with less noise, for example: - * @sample test.collections.MapTest.createUsingTo - */ -public fun A.to(that: B): Pair = Pair(this, that) /** * Calls the specified function [f] and returns its result. diff --git a/libraries/stdlib/src/kotlin/util/Tuples.kt b/libraries/stdlib/src/kotlin/util/Tuples.kt index 6d89eab63ea..8945c2cadce 100644 --- a/libraries/stdlib/src/kotlin/util/Tuples.kt +++ b/libraries/stdlib/src/kotlin/util/Tuples.kt @@ -28,6 +28,14 @@ public data class Pair( public override fun toString(): String = "($first, $second)" } +/** + * Creates a tuple of type [Pair] from this and [that]. + * + * This can be useful for creating [Map] literals with less noise, for example: + * @sample test.collections.MapTest.createUsingTo + */ +public fun A.to(that: B): Pair = Pair(this, that) + /** * Converts this pair into a list. */