diff --git a/compiler/frontend/src/jet/Collections.jet b/compiler/frontend/src/jet/Collections.jet index 866cd5e533f..c7bbbaf1c19 100644 --- a/compiler/frontend/src/jet/Collections.jet +++ b/compiler/frontend/src/jet/Collections.jet @@ -71,6 +71,13 @@ public trait MutableList : List, MutableCollection { public fun set(index : Int, element : E) : E public fun add(index : Int, element : E) public fun remove(index : Int) : E + + // List Iterators + override fun listIterator() : MutableListIterator + override fun listIterator(index : Int) : MutableListIterator + + // View + override fun subList(fromIndex : Int, toIndex : Int) : MutableList } public trait Set : Collection { @@ -130,7 +137,9 @@ public trait MutableMap : Map { public fun clear() // Views - override fun entrySet() : Set> + override fun keySet() : MutableSet + override fun values() : MutableCollection + override fun entrySet() : MutableSet> public trait MutableEntry : Map.Entry, Hashable { public fun setValue(value : V) : V diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index b42cfa02fc4..f4994d4f308 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -920,15 +920,15 @@ public abstract trait jet.MutableList : jet.List, jet.Mut public abstract override /*2*/ /*fake_override*/ fun isEmpty(): jet.Boolean public abstract override /*2*/ /*fake_override*/ fun iterator(): jet.Iterator public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ o: jet.Any?): jet.Int - public abstract override /*1*/ /*fake_override*/ fun listIterator(): jet.ListIterator - public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: jet.Int): jet.ListIterator + public abstract override /*1*/ fun listIterator(): jet.MutableListIterator + public abstract override /*1*/ fun listIterator(/*0*/ index: jet.Int): jet.MutableListIterator public abstract fun remove(/*0*/ index: jet.Int): E public abstract override /*1*/ fun remove(/*0*/ o: jet.Any?): jet.Boolean public abstract override /*1*/ fun removeAll(/*0*/ c: jet.Collection): jet.Boolean public abstract override /*1*/ fun retainAll(/*0*/ c: jet.Collection): jet.Boolean public abstract fun set(/*0*/ index: jet.Int, /*1*/ element: E): E public abstract override /*2*/ /*fake_override*/ fun size(): jet.Int - public abstract override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: jet.Int, /*1*/ toIndex: jet.Int): jet.List + public abstract override /*1*/ fun subList(/*0*/ fromIndex: jet.Int, /*1*/ toIndex: jet.Int): jet.MutableList public abstract override /*2*/ /*fake_override*/ fun toArray(): jet.Array public abstract override /*2*/ /*fake_override*/ fun toArray(/*0*/ a: jet.Array): jet.Array } @@ -947,7 +947,7 @@ public abstract trait jet.MutableMap : j public abstract fun clear(): jet.Tuple0 public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: jet.Any?): jet.Boolean public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: jet.Any?): jet.Boolean - public abstract override /*1*/ fun entrySet(): jet.Set> + public abstract override /*1*/ fun entrySet(): jet.MutableSet> public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: jet.Any?): V? public abstract override /*1*/ /*fake_override*/ fun isEmpty(): jet.Boolean public abstract trait jet.MutableMap.MutableEntry : jet.Map.Entry, jet.Hashable { @@ -957,12 +957,12 @@ public abstract trait jet.MutableMap : j public abstract override /*2*/ /*fake_override*/ fun hashCode(): jet.Int public abstract fun setValue(/*0*/ value: V): V } - public abstract override /*1*/ /*fake_override*/ fun keySet(): jet.Set + public abstract override /*1*/ fun keySet(): jet.MutableSet public abstract fun put(/*0*/ key: K, /*1*/ value: V): V? public abstract fun putAll(/*0*/ m: jet.Map): jet.Tuple0 public abstract fun remove(/*0*/ key: jet.Any?): V? public abstract override /*1*/ /*fake_override*/ fun size(): jet.Int - public abstract override /*1*/ /*fake_override*/ fun values(): jet.Collection + public abstract override /*1*/ fun values(): jet.MutableCollection } public abstract trait jet.MutableSet : jet.Set, jet.MutableCollection { public abstract override /*1*/ fun add(/*0*/ e: E): jet.Boolean diff --git a/jdk-annotations/java/util/annotations.xml b/jdk-annotations/java/util/annotations.xml index 699bdbac4fd..b3eb91eac83 100644 --- a/jdk-annotations/java/util/annotations.xml +++ b/jdk-annotations/java/util/annotations.xml @@ -26,12 +26,12 @@ - + - + @@ -41,7 +41,7 @@ - + @@ -131,12 +131,12 @@ - + - + @@ -356,12 +356,12 @@ - + - + @@ -376,7 +376,7 @@ - + diff --git a/js/js.libraries/src/core/javautil.kt b/js/js.libraries/src/core/javautil.kt index c3c45cd442e..2cd02777bf2 100644 --- a/js/js.libraries/src/core/javautil.kt +++ b/js/js.libraries/src/core/javautil.kt @@ -52,7 +52,7 @@ public abstract class AbstractList(): AbstractCollection(), MutableList override fun listIterator() : MutableListIterator = js.noImpl override fun listIterator(index : Int) : MutableListIterator = js.noImpl - override fun subList(fromIndex : Int, toIndex : Int) : List = js.noImpl + override fun subList(fromIndex : Int, toIndex : Int) : MutableList = js.noImpl } library @@ -74,9 +74,9 @@ public open class HashMap() : MutableMap { public override fun remove(key : Any?) : V? = js.noImpl public override fun clear() : Unit = js.noImpl public override fun containsValue(value : Any?) : Boolean = js.noImpl - public override fun keySet() : Set = js.noImpl - public override fun values() : Collection = js.noImpl - public override fun entrySet() : Set> = js.noImpl + public override fun keySet() : MutableSet = js.noImpl + public override fun values() : MutableCollection = js.noImpl + public override fun entrySet() : MutableSet> = js.noImpl } library