Fix "Placing function type parameters after the function name" errors in project

This commit is contained in:
Yan Zhulanow
2015-11-24 18:21:13 +03:00
parent 87799e9b6b
commit 278f1cd6ef
21 changed files with 46 additions and 46 deletions
+5 -5
View File
@@ -16,18 +16,18 @@
package java.util
public fun HashSet<E>(c: Collection<E>): HashSet<E>
public fun <E> HashSet(c: Collection<E>): HashSet<E>
= HashSet<E>(c.size()).apply { addAll(c) }
public fun LinkedHashSet<E>(c: Collection<E>): HashSet<E>
public fun <E> LinkedHashSet(c: Collection<E>): HashSet<E>
= LinkedHashSet<E>(c.size()).apply { addAll(c) }
public fun HashMap<K, V>(m: Map<K, V>): HashMap<K, V>
public fun <K, V> HashMap(m: Map<K, V>): HashMap<K, V>
= HashMap<K, V>(m.size()).apply { putAll(m) }
public fun LinkedHashMap<K, V>(m: Map<K, V>): LinkedHashMap<K, V>
public fun <K, V> LinkedHashMap(m: Map<K, V>): LinkedHashMap<K, V>
= LinkedHashMap<K, V>(m.size()).apply { putAll(m) }
public fun ArrayList<E>(c: Collection<E>): ArrayList<E>
public fun <E> ArrayList(c: Collection<E>): ArrayList<E>
= ArrayList<E>().apply { asDynamic().array = c.toTypedArray<Any?>() } // black dynamic magic
@@ -4,7 +4,7 @@ import java.lang.*
import java.util.*
public object Collections {
public fun max<T>(col: Collection<T>, comp: Comparator<in T>): T = java.util.max(col, comp)
public fun <T> max(col: Collection<T>, comp: Comparator<in T>): T = java.util.max(col, comp)
@Deprecated("Use list.sort() instead.", ReplaceWith("list.sort()"))
public fun <T: Comparable<T>> sort(list: MutableList<T>): Unit = java.util.sort(list, naturalOrder())
@@ -25,7 +25,7 @@ public object Collections {
}
@library("collectionsMax")
private fun max<T>(col: Collection<T>, comp: Comparator<in T>): T = noImpl
private fun <T> max(col: Collection<T>, comp: Comparator<in T>): T = noImpl
@library("collectionsSort")
private fun <T> sort(list: MutableList<T>, comparator: Comparator<in T>): Unit = noImpl
+2 -2
View File
@@ -26,8 +26,8 @@ public interface JsonClass {
public fun stringify(o: Any, replacer: Array<String>, space: Int): String
public fun stringify(o: Any, replacer: Array<String>, space: String): String
public fun parse<T>(text: String): T
public fun parse<T>(text: String, reviver: ((key: String, value: Any?)->Any?)): T
public fun <T> parse(text: String): T
public fun <T> parse(text: String, reviver: ((key: String, value: Any?)->Any?)): T
}
@native
+6 -6
View File
@@ -38,36 +38,36 @@ public fun <reified T> Collection<T>.toTypedArray(): Array<T> = noImpl
/**
* Returns an immutable list containing only the specified object [element].
*/
public fun listOf<T>(element: T): List<T> = arrayListOf(element)
public fun <T> listOf(element: T): List<T> = arrayListOf(element)
/**
* Returns an immutable set containing only the specified object [element].
*/
public fun setOf<T>(element: T): Set<T> = hashSetOf(element)
public fun <T> setOf(element: T): Set<T> = hashSetOf(element)
/**
* Returns an immutable map, mapping only the specified key to the
* specified value.
*/
public fun mapOf<K, V>(pair: Pair<K, V>): Map<K, V> = hashMapOf(pair)
public fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V> = hashMapOf(pair)
/**
* Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].
*/
public fun lazy<T>(initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
public fun <T> lazy(initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
/**
* Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].
*
* The [mode] parameter is ignored. */
public fun lazy<T>(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
public fun <T> lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
/**
* Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].
*
* The [lock] parameter is ignored.
*/
public fun lazy<T>(lock: Any?, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
public fun <T> lazy(lock: Any?, initializer: () -> T): Lazy<T> = UnsafeLazyImpl(initializer)
internal fun <T> arrayOfNulls(reference: Array<out T>, size: Int): Array<T> {