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
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.container
import java.util.ArrayList
import java.util.HashSet
public fun topologicalSort<T>(items: Iterable<T>, dependencies: (T) -> Iterable<T>): List<T> {
public fun <T> topologicalSort(items: Iterable<T>, dependencies: (T) -> Iterable<T>): List<T> {
val itemsInProgress = HashSet<T>()
val completedItems = HashSet<T>()
val result = ArrayList<T>()
@@ -91,7 +91,7 @@ public fun PsiElement.nextLeaf(filter: (PsiElement) -> Boolean): PsiElement? {
return leaf
}
public fun PsiElement.getParentOfTypesAndPredicate<T : PsiElement>(
public fun <T : PsiElement> PsiElement.getParentOfTypesAndPredicate(
strict: Boolean = false, vararg parentClasses: Class<T>, predicate: (T) -> Boolean
): T? {
var element = if (strict) getParent() else this
@@ -110,27 +110,27 @@ public fun PsiElement.getParentOfTypesAndPredicate<T : PsiElement>(
return null
}
public fun PsiElement.getNonStrictParentOfType<T : PsiElement>(parentClass: Class<T>): T? {
public fun <T : PsiElement> PsiElement.getNonStrictParentOfType(parentClass: Class<T>): T? {
return PsiTreeUtil.getParentOfType(this, parentClass, false)
}
inline public fun PsiElement.getParentOfType<reified T : PsiElement>(strict: Boolean): T? {
inline public fun <reified T : PsiElement> PsiElement.getParentOfType(strict: Boolean): T? {
return PsiTreeUtil.getParentOfType(this, javaClass<T>(), strict)
}
inline public fun PsiElement.getStrictParentOfType<reified T : PsiElement>(): T? {
inline public fun <reified T : PsiElement> PsiElement.getStrictParentOfType(): T? {
return PsiTreeUtil.getParentOfType(this, javaClass<T>(), true)
}
inline public fun PsiElement.getNonStrictParentOfType<reified T : PsiElement>(): T? {
inline public fun <reified T : PsiElement> PsiElement.getNonStrictParentOfType(): T? {
return PsiTreeUtil.getParentOfType(this, javaClass<T>(), false)
}
inline public fun PsiElement.getChildOfType<reified T : PsiElement>(): T? {
inline public fun <reified T : PsiElement> PsiElement.getChildOfType(): T? {
return PsiTreeUtil.getChildOfType(this, javaClass<T>())
}
inline public fun PsiElement.getChildrenOfType<reified T : PsiElement>(): Array<T> {
inline public fun <reified T : PsiElement> PsiElement.getChildrenOfType(): Array<T> {
return PsiTreeUtil.getChildrenOfType(this, javaClass<T>()) ?: arrayOf()
}
@@ -148,7 +148,7 @@ public fun <T : PsiElement> T.getIfChildIsInBranch(element: PsiElement, branch:
return if (branch().isAncestor(element)) this else null
}
public inline fun PsiElement.getParentOfTypeAndBranch<reified T : PsiElement>(strict: Boolean = false, noinline branch: T.() -> PsiElement?): T? {
public inline fun <reified T : PsiElement> PsiElement.getParentOfTypeAndBranch(strict: Boolean = false, noinline branch: T.() -> PsiElement?): T? {
return getParentOfType<T>(strict)?.getIfChildIsInBranch(this, branch)
}
@@ -88,7 +88,7 @@ public abstract class PerformanceCounter protected constructor(val name: String)
count++
}
public final fun time<T>(block: () -> T): T {
public final fun <T> time(block: () -> T): T {
count++
if (!enabled) return block()
@@ -110,7 +110,7 @@ public abstract class PerformanceCounter protected constructor(val name: String)
totalTimeNanos += delta
}
protected abstract fun countTime<T>(block: () -> T): T
protected abstract fun <T> countTime(block: () -> T): T
public fun report(consumer: (String) -> Unit) {
if (totalTimeNanos == 0L) {