Create From Usage: Do not generate unnecessary/skip necessary empty lines
This commit is contained in:
@@ -109,10 +109,15 @@ public class JetPsiFactory(private val project: Project) {
|
||||
return createProperty("val${text}x").findElementAt(3)!!
|
||||
}
|
||||
|
||||
// Remove when all Java usages are rewritten to Kotlin
|
||||
public fun createNewLine(): PsiElement {
|
||||
return createWhiteSpace("\n")
|
||||
}
|
||||
|
||||
public fun createNewLine(lineBreaks: Int): PsiElement {
|
||||
return createWhiteSpace("\n".repeat(lineBreaks))
|
||||
}
|
||||
|
||||
public fun createClass(text: String): JetClass {
|
||||
return createDeclaration(text)
|
||||
}
|
||||
|
||||
+41
-36
@@ -66,6 +66,8 @@ import org.jetbrains.jet.plugin.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.jet.plugin.quickfix.createFromUsage.createClass.ClassKind
|
||||
import org.jetbrains.jet.plugin.util.isAny
|
||||
import org.jetbrains.jet.utils.addToStdlib.singletonOrEmptyList
|
||||
import org.jetbrains.jet.lang.psi.psiUtil.siblings
|
||||
import org.jetbrains.jet.plugin.refactoring.getLineCount
|
||||
|
||||
private val TYPE_PARAMETER_LIST_VARIABLE_NAME = "typeParameterList"
|
||||
private val TEMPLATE_FROM_USAGE_FUNCTION_BODY = "New Kotlin Function Body.kt"
|
||||
@@ -427,40 +429,31 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
|
||||
val newLine = psiFactory.createNewLine()
|
||||
|
||||
fun prepend(element: PsiElement, elementBeforeStart: PsiElement, skipInitial: Boolean): PsiElement {
|
||||
val parent = elementBeforeStart.getParent()!!
|
||||
val anchor =
|
||||
if (!skipInitial && elementBeforeStart !is PsiWhiteSpace) {
|
||||
elementBeforeStart
|
||||
fun calcNecessaryEmptyLines(decl: JetDeclaration, after: Boolean): Int {
|
||||
var lineBreaksPresent: Int = 0
|
||||
var neighbor: PsiElement? = null
|
||||
for (sibling in decl.siblings(forward = after, withItself = false)) {
|
||||
when (sibling) {
|
||||
is PsiWhiteSpace -> lineBreaksPresent += (sibling.getText() ?: "").count { it == '\n' }
|
||||
else -> {
|
||||
neighbor = sibling
|
||||
break
|
||||
}
|
||||
else {
|
||||
PsiTreeUtil.skipSiblingsForward(elementBeforeStart, javaClass<PsiWhiteSpace>())
|
||||
}
|
||||
val addedElement = parent.addBefore(element, anchor)!!
|
||||
parent.addAfter(newLine, addedElement)
|
||||
parent.addAfter(newLine, addedElement)
|
||||
return addedElement
|
||||
}
|
||||
|
||||
fun append(element: PsiElement, elementAfterEnd: PsiElement, skipInitial: Boolean): PsiElement {
|
||||
val parent = elementAfterEnd.getParent()!!
|
||||
val anchor =
|
||||
if (!skipInitial && elementAfterEnd !is PsiWhiteSpace) {
|
||||
elementAfterEnd
|
||||
}
|
||||
else {
|
||||
PsiTreeUtil.skipSiblingsBackward(elementAfterEnd, javaClass<PsiWhiteSpace>())
|
||||
}
|
||||
val addedElement = parent.addAfter(element, anchor)!!
|
||||
if (anchor?.getNode()?.getElementType() != JetTokens.LBRACE) {
|
||||
parent.addAfter(newLine, anchor)
|
||||
parent.addAfter(newLine, anchor)
|
||||
}
|
||||
}
|
||||
return addedElement
|
||||
|
||||
val neighborType = neighbor?.getNode()?.getElementType()
|
||||
val lineBreaksNeeded = when {
|
||||
neighborType == JetTokens.LBRACE, neighborType == JetTokens.RBRACE -> 1
|
||||
neighbor is JetDeclaration && (neighbor !is JetProperty || decl !is JetProperty) -> 2
|
||||
else -> 1
|
||||
}
|
||||
|
||||
return Math.max(lineBreaksNeeded - lineBreaksPresent, 0)
|
||||
}
|
||||
|
||||
when (containingElement) {
|
||||
is JetFile -> return append(declaration, containingElement.getLastChild()!!, false) as JetNamedDeclaration
|
||||
val declarationInPlace = when (containingElement) {
|
||||
is JetFile -> containingElement.add(declaration) as JetNamedDeclaration
|
||||
|
||||
is JetClassOrObject -> {
|
||||
var classBody = containingElement.getBody()
|
||||
@@ -470,11 +463,13 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
}
|
||||
|
||||
if (declaration is JetNamedFunction) {
|
||||
val rBrace = classBody!!.getRBrace()
|
||||
return (rBrace?.let { append(declaration, it, true) }
|
||||
?: append(declaration, classBody!!.getLastChild()!!, false)) as JetNamedDeclaration
|
||||
val anchor = PsiTreeUtil.skipSiblingsBackward(
|
||||
classBody!!.getRBrace() ?: classBody!!.getLastChild()!!,
|
||||
javaClass<PsiWhiteSpace>()
|
||||
)
|
||||
classBody.addAfter(declaration, anchor) as JetNamedDeclaration
|
||||
}
|
||||
return prepend(declaration, classBody!!.getLBrace()!!, true) as JetNamedDeclaration
|
||||
else classBody.addAfter(declaration, classBody!!.getLBrace()!!) as JetNamedDeclaration
|
||||
}
|
||||
|
||||
is JetBlockExpression -> {
|
||||
@@ -485,13 +480,23 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
parent.addAfter(newLine, containingElement)
|
||||
}
|
||||
|
||||
return prepend(declaration, containingElement.getFirstChild()!!, false) as JetNamedDeclaration
|
||||
containingElement.addBefore(declaration, containingElement.getFirstChild()!!) as JetNamedDeclaration
|
||||
}
|
||||
return prepend(declaration, containingElement.getLBrace()!!, true) as JetNamedDeclaration
|
||||
else containingElement.addAfter(declaration, containingElement.getLBrace()!!) as JetNamedDeclaration
|
||||
}
|
||||
|
||||
else -> throw AssertionError("Invalid containing element: ${containingElement.getText()}")
|
||||
}
|
||||
|
||||
val parent = declarationInPlace.getParent()
|
||||
calcNecessaryEmptyLines(declarationInPlace, false).let {
|
||||
if (it > 0) parent.addBefore(psiFactory.createNewLine(it), declarationInPlace)
|
||||
}
|
||||
calcNecessaryEmptyLines(declarationInPlace, true).let {
|
||||
if (it > 0) parent.addAfter(psiFactory.createNewLine(it), declarationInPlace)
|
||||
}
|
||||
|
||||
return declarationInPlace
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ foo(1, "2") fun test() {
|
||||
|
||||
}
|
||||
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo
|
||||
annotation class foo
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo
|
||||
annotation class foo
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
annotation class foo(val i: Int, val s: String)
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo(val value: Int)
|
||||
annotation class foo(val value: Int)
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class foo(val fooBar: Int)
|
||||
annotation class foo(val fooBar: Int)
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class bar(val s: String, val i: Int)
|
||||
annotation class bar(val s: String, val i: Int)
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun test() {
|
||||
|
||||
class Foo {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ class A {
|
||||
|
||||
class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun test() = Foo(2, "2")
|
||||
|
||||
class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
class Foo(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() = Foo(abc = 1, ghi = A(2), def = "s")
|
||||
|
||||
class Foo(abc: Int, ghi: A, def: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -3,7 +3,6 @@
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>U</td></tr><tr><td>Found:</td><td>U</td></tr></table></html>
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
inner class Foo<U>(u: U) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
class Foo(i: Int, s: String, function: Function1<Int, Int>) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
class Foo(function: Function1<Int, Int>) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
object A {
|
||||
|
||||
class Foo(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() = Foo(2, "2")
|
||||
|
||||
class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
inner class Foo(i: Int) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): A = Foo(2, "2")
|
||||
|
||||
class Foo(i: Int, s: String) : A() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ fun test(): A = Foo(2, "2")
|
||||
|
||||
class Foo(i: Int, s: String) : A() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): A = Foo(2, "2")
|
||||
|
||||
class Foo(i: Int, s: String) : A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
|
||||
inner class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class bar(val s: String, val i: Int)
|
||||
annotation class bar(val s: String, val i: Int)
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class bar(val value: String)
|
||||
annotation class bar(val value: String)
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
|
||||
}
|
||||
|
||||
annotation class bar(val fooBar: String)
|
||||
annotation class bar(val fooBar: String)
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
class Foo(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
class B<T>(val t: T) {
|
||||
|
||||
class Foo<U, V>(u: U, v: V) {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -3,7 +3,6 @@
|
||||
// ERROR: An integer literal does not conform to the expected type U
|
||||
|
||||
class B<T>(val t: T) {
|
||||
|
||||
inner class Foo<U, V>(u: U, v: V) {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>U</td></tr><tr><td>Found:</td><td>kotlin.String</td></tr></table></html>
|
||||
|
||||
class B<T>(val t: T) {
|
||||
|
||||
inner class Foo<U>(i: Int, u: U) {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -3,7 +3,6 @@
|
||||
// ERROR: An integer literal does not conform to the expected type V
|
||||
|
||||
class B<T>(val t: T) {
|
||||
|
||||
inner class Foo<U, V, W>(v: V, w: W) {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
// "Create class 'Foo'" "true"
|
||||
|
||||
class B<T>(val t: T) {
|
||||
|
||||
class Foo<U>(i: Int, u: U) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun test() = Foo<String, Int>(2, "2")
|
||||
|
||||
class Foo<T, U>(u: U, t: T) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun test() = Foo<String, Int, Boolean>(2, "2")
|
||||
|
||||
class Foo<T, U, V>(u: U, t: T) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun test() = Foo<String, Int>(2, "2")
|
||||
|
||||
class Foo<T, U>(u: U, t: T) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun test() = Foo<Int>(2, "2")
|
||||
|
||||
class Foo<T>(t: T, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun test(a: A): A = Foo<A, Int>(a, 1)
|
||||
|
||||
class Foo<T, U>(a: T, u: U) : A() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ class Foo: A(1, "2") {
|
||||
|
||||
open class A(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package p
|
||||
|
||||
class X {
|
||||
|
||||
open class A(i: Int, s: String) {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ class Foo: p.A(1, "2") {
|
||||
|
||||
open class A(i: Int, s: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ class Foo: A(abc = 1, ghi = "2", def = B()) {
|
||||
|
||||
open class A(abc: Int, ghi: String, def: B) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ class Foo: A<Int, String>(1, "2") {
|
||||
|
||||
open class A<T, U>(t: T, u: U) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ class Foo: A {
|
||||
|
||||
trait A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ package p
|
||||
|
||||
import p.A
|
||||
|
||||
annotation class A
|
||||
annotation class A
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
|
||||
annotation class A
|
||||
|
||||
}
|
||||
+1
-1
@@ -5,4 +5,4 @@ import p.A
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.E.A
|
||||
|
||||
enum class E {
|
||||
|
||||
A
|
||||
|
||||
}
|
||||
+1
-1
@@ -5,4 +5,4 @@ import p.A
|
||||
|
||||
enum class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
|
||||
enum class A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ import p.A
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ import p.A
|
||||
|
||||
trait A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
import p.X.A
|
||||
|
||||
class X {
|
||||
|
||||
trait A {
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -5,7 +5,6 @@ package p
|
||||
fun foo() = A.B.C
|
||||
|
||||
class A {
|
||||
|
||||
class B {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo() = A.B
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo() = A.B
|
||||
|
||||
enum class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
fun foo() = X.A
|
||||
|
||||
enum class X {
|
||||
|
||||
A
|
||||
|
||||
}
|
||||
-1
@@ -5,7 +5,6 @@ package p
|
||||
fun foo() = X.A
|
||||
|
||||
enum class X(n: Int) {
|
||||
|
||||
A : X()
|
||||
|
||||
}
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
fun foo(): E = E.A
|
||||
|
||||
enum class E {
|
||||
|
||||
A
|
||||
|
||||
}
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo() = A.B
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo() = p.A
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo() = A
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ package p
|
||||
fun foo() = X.A
|
||||
|
||||
class X {
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ open class X {
|
||||
|
||||
object A : X() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ trait X {
|
||||
|
||||
object A : X {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo() = A.B
|
||||
|
||||
trait A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
object Foo {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ package p
|
||||
|
||||
fun foo(): A = throw Throwable("")
|
||||
|
||||
annotation class A
|
||||
annotation class A
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo(): p.A = throw Throwable("")
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo(): A = throw Throwable("")
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo(): A<Int, String> = throw Throwable("")
|
||||
|
||||
class A<T, U> {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo(): A.B = throw Throwable("")
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
package p
|
||||
|
||||
class T {
|
||||
|
||||
class A {
|
||||
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create class 'A'" "true"
|
||||
package p
|
||||
|
||||
class T {
|
||||
class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(): T.A = throw Throwable("")
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo(): A = throw Throwable("")
|
||||
|
||||
enum class A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun foo(): A.B = throw Throwable("")
|
||||
|
||||
object A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo(): A = throw Throwable("")
|
||||
|
||||
trait A {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create class 'A'" "true"
|
||||
package p
|
||||
|
||||
class T
|
||||
|
||||
fun foo(): T.<caret>A = throw Throwable("")
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun test() {
|
||||
|
||||
fun Int.plus(A: A<Int>): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
fun Unit.foo(i: Int): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ fun test() {
|
||||
|
||||
fun Int.foo(A: A<Int>): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun test() {
|
||||
|
||||
fun foo(i: Int, s: String) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ fun test() {
|
||||
|
||||
fun foo(): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): Int {
|
||||
|
||||
fun foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
fun foo(i: Int, s: String) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ fun test(): Int {
|
||||
|
||||
fun Any.foo(i: Int, s: String): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ class A<T>(val items: List<T>) {
|
||||
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ class A<T>(val items: List<T>) {
|
||||
|
||||
fun <E, T> List<E>.foo(t: T, s: String): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ class A<T>(val items: List<T>) {
|
||||
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): Int {
|
||||
|
||||
fun <T, U> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): Int {
|
||||
|
||||
fun <T, U, V> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): Int {
|
||||
|
||||
fun <T, U> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test(): Int {
|
||||
|
||||
fun <T> foo(t: T, s: String): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,4 +19,4 @@ fun foo() {
|
||||
|
||||
fun Any.component2(): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun test(): A<String> {
|
||||
|
||||
fun Int.invoke(i: Int, s: String): A<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun test() {
|
||||
|
||||
fun Boolean.minus(): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user