From fc0077cf9bb02be60cc1535a144813eb4d199228 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Wed, 5 Jun 2013 20:33:21 +0400 Subject: [PATCH] removed explicit type arguments from delegation tests where possible --- .../test/properties/delegation/DelegationTest.kt | 2 +- .../properties/delegation/MapDelegationTest.kt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/stdlib/test/properties/delegation/DelegationTest.kt b/libraries/stdlib/test/properties/delegation/DelegationTest.kt index 4098956d993..0dcde1d12c3 100644 --- a/libraries/stdlib/test/properties/delegation/DelegationTest.kt +++ b/libraries/stdlib/test/properties/delegation/DelegationTest.kt @@ -25,7 +25,7 @@ class DelegationTest(): DelegationTestBase() { } public class TestNotNullVar(val a1: String, val b1: T): WithBox { - var a: String by Delegates.notNull() + var a: String by Delegates.notNull() var b by Delegates.notNull() override fun box(): String { diff --git a/libraries/stdlib/test/properties/delegation/MapDelegationTest.kt b/libraries/stdlib/test/properties/delegation/MapDelegationTest.kt index b6df3fc21fb..5b714fa1bc8 100644 --- a/libraries/stdlib/test/properties/delegation/MapDelegationTest.kt +++ b/libraries/stdlib/test/properties/delegation/MapDelegationTest.kt @@ -66,8 +66,8 @@ class TestMapValWithDifferentTypes(): WithBox { class TestMapVarWithDifferentTypes(): WithBox { val map: HashMap = hashMapOf("a" to "a", "b" to 1, "c" to A(1), "d" to "d") - var a by Delegates.mapVar(map) - var b by Delegates.mapVar(map) + var a: String by Delegates.mapVar(map) + var b: Int by Delegates.mapVar(map) var c by Delegates.mapVar(map) var d by Delegates.mapVar(map) @@ -100,7 +100,7 @@ class TestNullableKey: WithBox { class TestMapPropertyString(): WithBox { val map = hashMapOf("a" to "a", "b" to "b", "c" to "c":Any?) - val a by Delegates.mapVal(map) + val a: String by Delegates.mapVal(map) var b by Delegates.mapVar(map) val c by Delegates.mapVal(map) @@ -115,9 +115,9 @@ class TestMapPropertyString(): WithBox { class TestMapValWithDefault(): WithBox { val map = hashMapOf() - val a by Delegates.mapVal(map, default = { ref, desc -> "aDefault" }) - val b by FixedMapVal(map, default = { ref, desc -> "bDefault" }, key = {"b"}) - val c by FixedMapVal(map, default = { ref, desc -> "cDefault" }, key = { desc -> desc.name }) + val a: String by Delegates.mapVal(map, default = { ref, desc -> "aDefault" }) + val b: String by FixedMapVal(map, default = { (ref: TestMapValWithDefault, desc: String) -> "bDefault" }, key = {"b"}) + val c: String by FixedMapVal(map, default = { (ref: TestMapValWithDefault, desc: String) -> "cDefault" }, key = { desc -> desc.name }) override fun box(): String { if (a != "aDefault") return "fail at 'a'" @@ -130,8 +130,8 @@ class TestMapValWithDefault(): WithBox { class TestMapVarWithDefault(): WithBox { val map = hashMapOf() var a: String by Delegates.mapVar(map, default = {ref, desc -> "aDefault" }) - var b: String by FixedMapVar(map, default = {ref, desc -> "bDefault" }, key = {"b"}) - var c: String by FixedMapVar(map, default = {ref, desc -> "cDefault" }, key = { desc -> desc.name }) + var b: String by FixedMapVar(map, default = {(ref: Any?, desc: String) -> "bDefault" }, key = {"b"}) + var c: String by FixedMapVar(map, default = {(ref: Any?, desc: String) -> "cDefault" }, key = { desc -> desc.name }) override fun box(): String { if (a != "aDefault") return "fail at 'a'"