Fix doc wording around covariance/invariance

This commit is contained in:
Ilya Gorbunov
2020-07-28 14:38:08 +03:00
parent 4f73e08704
commit 99eb7f391b
19 changed files with 85 additions and 98 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.collections
@@ -9,7 +9,7 @@ import kotlin.js.JsName
/**
* Provides a skeletal implementation of the read-only [Collection] interface.
*
* @param E the type of elements contained in the collection. The collection is covariant on its element type.
* @param E the type of elements contained in the collection. The collection is covariant in its element type.
*/
@SinceKotlin("1.1")
public abstract class AbstractCollection<out E> protected constructor() : Collection<E> {
@@ -1,7 +1,8 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
/*
* Based on GWT AbstractList
* Copyright 2007 Google Inc.
@@ -14,7 +15,7 @@ package kotlin.collections
*
* This class is intended to help implementing read-only lists so it doesn't support concurrent modification tracking.
*
* @param E the type of elements contained in the list. The list is covariant on its element type.
* @param E the type of elements contained in the list. The list is covariant in its element type.
*/
@SinceKotlin("1.1")
public abstract class AbstractList<out E> protected constructor() : AbstractCollection<E>(), List<E> {
@@ -1,7 +1,8 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
/*
* Based on GWT AbstractMap
* Copyright 2007 Google Inc.
@@ -14,8 +15,8 @@ package kotlin.collections
*
* The implementor is required to implement [entries] property, which should return read-only set of map entries.
*
* @param K the type of map keys. The map is invariant on its key type.
* @param V the type of map values. The map is covariant on its value type.
* @param K the type of map keys. The map is invariant in its key type.
* @param V the type of map values. The map is covariant in its value type.
*/
@SinceKotlin("1.1")
public abstract class AbstractMap<K, out V> protected constructor() : Map<K, V> {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin.collections
@@ -9,7 +9,7 @@ package kotlin.collections
*
* This class is intended to help implementing read-only sets so it doesn't support concurrent modification tracking.
*
* @param E the type of elements contained in the set. The set is covariant on its element type.
* @param E the type of elements contained in the set. The set is covariant in its element type.
*/
@SinceKotlin("1.1")
public abstract class AbstractSet<out E> protected constructor() : AbstractCollection<E>(), Set<E> {