From 976260bda682ff9dbe3f6f6b182254c2b066c503 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Mon, 26 Sep 2016 21:46:48 +0300 Subject: [PATCH] Fix state check in ListIterator.set, improve diagnostics. --- js/js.libraries/src/core/collections/AbstractMutableList.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/js.libraries/src/core/collections/AbstractMutableList.kt b/js/js.libraries/src/core/collections/AbstractMutableList.kt index e2b0f2c74c5..69c75045dc6 100644 --- a/js/js.libraries/src/core/collections/AbstractMutableList.kt +++ b/js/js.libraries/src/core/collections/AbstractMutableList.kt @@ -115,7 +115,7 @@ public abstract class AbstractMutableList protected constructor() : AbstractM } override fun remove() { - check(last != -1) + check(last != -1) { "Call next() or previous() before removing element from the iterator."} removeAt(last) index = last @@ -153,7 +153,7 @@ public abstract class AbstractMutableList protected constructor() : AbstractM } override fun set(element: E) { - require(last != -1) + check(last != -1) { "Call next() or previous() before updating element value with the iterator."} this@AbstractMutableList[last] = element } }