stdlib fixes:

- 'sequence(initialValue: T?, ...)' should have LowPriorityInOverloadResolution
(otherwise 'sequence({...}, {...})' is ambiguous).
- 'copyOf' and 'copyOfRange' should be defined for 'Array<T>' only
('Array<out T>' version always loses to 'Array<T>', since the second one
is always more specific).
This commit is contained in:
Dmitry Petrov
2015-12-28 15:12:35 +03:00
parent 02daeac41b
commit c97294a066
3 changed files with 4 additions and 27 deletions
@@ -57,7 +57,7 @@ fun specialJVM(): List<GenericFunction> {
templates add f("copyOfRange(fromIndex: Int, toIndex: Int)") {
only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives)
only(InvariantArraysOfObjects, ArraysOfPrimitives)
doc { "Returns new array which is a copy of range of original array." }
returns("SELF")
annotations(InvariantArraysOfObjects) { """@JvmName("mutableCopyOfRange")"""}
@@ -67,7 +67,7 @@ fun specialJVM(): List<GenericFunction> {
}
templates add f("copyOf()") {
only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives)
only(InvariantArraysOfObjects, ArraysOfPrimitives)
doc { "Returns new array which is a copy of the original array." }
returns("SELF")
annotations(InvariantArraysOfObjects) { """@JvmName("mutableCopyOf")"""}
@@ -78,7 +78,7 @@ fun specialJVM(): List<GenericFunction> {
// This overload can cause nulls if array size is expanding, hence different return overload
templates add f("copyOf(newSize: Int)") {
only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives)
only(InvariantArraysOfObjects, ArraysOfPrimitives)
doc { "Returns new array which is a copy of the original array." }
returns("SELF")
body {