FIR IDE: enable override implement test for FIR
This commit is contained in:
committed by
TeamCityServer
parent
00031c8eb1
commit
53aafbd7d9
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 org.jetbrains.kotlin.codeinsight
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.idea.codeInsight.Java8OverrideImplementTest
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtClassMember
|
||||||
|
import org.jetbrains.kotlin.idea.invalidateCaches
|
||||||
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
|
internal class FirJava8OverrideImplementTest : Java8OverrideImplementTest<KtClassMember>(), FirOverrideImplementTestMixIn {
|
||||||
|
override fun isFirPlugin(): Boolean = true
|
||||||
|
|
||||||
|
override fun tearDown() {
|
||||||
|
project.invalidateCaches(file as? KtFile)
|
||||||
|
super.tearDown()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 org.jetbrains.kotlin.codeinsight
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.idea.codeInsight.OverrideImplementTest
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtClassMember
|
||||||
|
import org.jetbrains.kotlin.idea.invalidateCaches
|
||||||
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
|
internal class FirOverrideImplementTest : OverrideImplementTest<KtClassMember>(), FirOverrideImplementTestMixIn {
|
||||||
|
override fun isFirPlugin(): Boolean = true
|
||||||
|
|
||||||
|
override fun tearDown() {
|
||||||
|
project.invalidateCaches(file as? KtFile)
|
||||||
|
super.tearDown()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 org.jetbrains.kotlin.codeinsight
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.idea.codeInsight.OverrideImplementTestMixIn
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.AbstractGenerateMembersHandler
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtClassMember
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtImplementMembersHandler
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtOverrideMembersHandler
|
||||||
|
import org.jetbrains.kotlin.idea.frontend.api.analyse
|
||||||
|
import org.jetbrains.kotlin.idea.frontend.api.symbols.markers.KtNamedSymbol
|
||||||
|
import org.jetbrains.kotlin.idea.frontend.api.tokens.HackToForceAllowRunningAnalyzeOnEDT
|
||||||
|
import org.jetbrains.kotlin.idea.frontend.api.tokens.hackyAllowRunningOnEdt
|
||||||
|
import org.jetbrains.kotlin.idea.invalidateCaches
|
||||||
|
import org.jetbrains.kotlin.name.StandardClassIds
|
||||||
|
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||||
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
|
||||||
|
internal interface FirOverrideImplementTestMixIn : OverrideImplementTestMixIn<KtClassMember> {
|
||||||
|
override fun createImplementMembersHandler(): AbstractGenerateMembersHandler<KtClassMember> = KtImplementMembersHandler()
|
||||||
|
|
||||||
|
override fun createOverrideMembersHandler(): AbstractGenerateMembersHandler<KtClassMember> = KtOverrideMembersHandler()
|
||||||
|
|
||||||
|
@OptIn(HackToForceAllowRunningAnalyzeOnEDT::class)
|
||||||
|
override fun isMemberOfAny(parentClass: KtClassOrObject, chooserObject: KtClassMember): Boolean {
|
||||||
|
return hackyAllowRunningOnEdt {
|
||||||
|
analyse(parentClass) {
|
||||||
|
chooserObject.symbol.callableIdIfNonLocal?.classId == StandardClassIds.Any
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(HackToForceAllowRunningAnalyzeOnEDT::class)
|
||||||
|
override fun getMemberName(parentClass: KtClassOrObject, chooserObject: KtClassMember): String {
|
||||||
|
return hackyAllowRunningOnEdt {
|
||||||
|
analyse(parentClass) {
|
||||||
|
(chooserObject.symbol as? KtNamedSymbol)?.name?.asString() ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(HackToForceAllowRunningAnalyzeOnEDT::class)
|
||||||
|
override fun getContainingClassName(parentClass: KtClassOrObject, chooserObject: KtClassMember): String {
|
||||||
|
return hackyAllowRunningOnEdt {
|
||||||
|
analyse(parentClass) {
|
||||||
|
chooserObject.symbol.callableIdIfNonLocal?.classId?.shortClassName?.asString() ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 org.jetbrains.kotlin.codeinsight
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.idea.codeInsight.OverrideImplementWithLibTest
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.KtClassMember
|
||||||
|
import org.jetbrains.kotlin.idea.invalidateCaches
|
||||||
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
|
internal class FirOverrideImplementWithLibTest : OverrideImplementWithLibTest<KtClassMember>(), FirOverrideImplementTestMixIn {
|
||||||
|
override fun isFirPlugin(): Boolean = true
|
||||||
|
|
||||||
|
override fun tearDown() {
|
||||||
|
project.invalidateCaches(file as? KtFile)
|
||||||
|
super.tearDown()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+17
-9
@@ -204,22 +204,22 @@ object IgnoreTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun cleanUpIdenticalFirTestFile(originalTestFile: File) {
|
fun cleanUpIdenticalFirTestFile(
|
||||||
val firTestFile = deriveFirTestFile(originalTestFile)
|
originalTestFile: File,
|
||||||
|
firTestFile: File = deriveFirTestFile(originalTestFile),
|
||||||
|
additionalFileToMarkFirIdentical: File? = null
|
||||||
|
) {
|
||||||
if (firTestFile.exists() && firTestFile.readText().trim() == originalTestFile.readText().trim()) {
|
if (firTestFile.exists() && firTestFile.readText().trim() == originalTestFile.readText().trim()) {
|
||||||
val message = if (isTeamCityBuild) {
|
val message = if (isTeamCityBuild) {
|
||||||
"Please remove .fir.kt dump and add // FIR_IDENTICAL to test source"
|
"Please remove $firTestFile and add // FIR_IDENTICAL to test source file $originalTestFile"
|
||||||
} else {
|
} else {
|
||||||
// The FIR test file is identical with the original file. We should remove the FIR file and mark "FIR_IDENTICAL" in the
|
// The FIR test file is identical with the original file. We should remove the FIR file and mark "FIR_IDENTICAL" in the
|
||||||
// original file
|
// original file
|
||||||
firTestFile.delete()
|
firTestFile.delete()
|
||||||
val content = originalTestFile.readText()
|
originalTestFile.prependFirIdentical()
|
||||||
originalTestFile.writer().use {
|
additionalFileToMarkFirIdentical?.prependFirIdentical()
|
||||||
it.appendLine(DIRECTIVES.FIR_IDENTICAL)
|
|
||||||
it.append(content)
|
|
||||||
}
|
|
||||||
|
|
||||||
"Deleted .fir.kt dump, added // FIR_IDENTICAL to test source"
|
"Deleted $firTestFile, added // FIR_IDENTICAL to test source file $originalTestFile"
|
||||||
}
|
}
|
||||||
KtAssert.fail(
|
KtAssert.fail(
|
||||||
"""
|
"""
|
||||||
@@ -231,6 +231,14 @@ object IgnoreTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun File.prependFirIdentical() {
|
||||||
|
val content = readText()
|
||||||
|
writer().use {
|
||||||
|
it.appendLine(DIRECTIVES.FIR_IDENTICAL)
|
||||||
|
it.append(content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun deriveFirTestFile(originalTestFile: File) =
|
private fun deriveFirTestFile(originalTestFile: File) =
|
||||||
originalTestFile.parentFile.resolve(originalTestFile.name.removeSuffix(".kt") + ".fir.kt")
|
originalTestFile.parentFile.resolve(originalTestFile.name.removeSuffix(".kt") + ".fir.kt")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.test
|
package org.jetbrains.kotlin.idea.test
|
||||||
|
|
||||||
|
import com.intellij.lang.annotation.HighlightSeverity
|
||||||
import com.intellij.openapi.editor.Document
|
import com.intellij.openapi.editor.Document
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.psi.PsiDocumentManager
|
import com.intellij.psi.PsiDocumentManager
|
||||||
import com.intellij.testFramework.LightPlatformTestCase
|
import com.intellij.testFramework.LightPlatformTestCase
|
||||||
|
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||||
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory
|
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory
|
||||||
import org.jetbrains.kotlin.diagnostics.Severity
|
import org.jetbrains.kotlin.diagnostics.Severity
|
||||||
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
|
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
|
||||||
@@ -17,7 +19,6 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
|
|||||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
fun KtFile.dumpTextWithErrors(ignoreErrors: Set<DiagnosticFactory<*>> = emptySet()): String {
|
fun KtFile.dumpTextWithErrors(ignoreErrors: Set<DiagnosticFactory<*>> = emptySet()): String {
|
||||||
val text = text
|
val text = text
|
||||||
@@ -31,6 +32,13 @@ fun KtFile.dumpTextWithErrors(ignoreErrors: Set<DiagnosticFactory<*>> = emptySet
|
|||||||
return header + text
|
return header + text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun JavaCodeInsightTestFixture.dumpErrorLines(): List<String> {
|
||||||
|
if (InTextDirectivesUtils.isDirectiveDefined(file.text, "// DISABLE-ERRORS")) return emptyList()
|
||||||
|
return doHighlighting().filter { it.severity == HighlightSeverity.ERROR }.map {
|
||||||
|
"// ERROR: ${it.description.replace('\n', ' ')}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun closeAndDeleteProject() = LightPlatformTestCase.closeAndDeleteProject()
|
fun closeAndDeleteProject() = LightPlatformTestCase.closeAndDeleteProject()
|
||||||
|
|
||||||
fun invalidateLibraryCache(project: Project) {
|
fun invalidateLibraryCache(project: Project) {
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun getFoo(): String = ""
|
fun getFoo(): String = ""
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun getFoo(): String = ""
|
fun getFoo(): String = ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ERROR: Conflicting overloads: public open fun foo(): Unit defined in C, public open fun foo(): Unit defined in C
|
// ERROR: [CONFLICTING_OVERLOADS] Conflicting overloads: public open fun foo(): Unit defined in C, public open fun foo(): Unit defined in C
|
||||||
// ERROR: Conflicting overloads: public open fun foo(): Unit defined in C, public open fun foo(): Unit defined in C
|
// ERROR: [CONFLICTING_OVERLOADS] Conflicting overloads: public open fun foo(): Unit defined in C, public open fun foo(): Unit defined in C
|
||||||
interface I {
|
interface I {
|
||||||
open fun foo(){}
|
open fun foo(){}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// ERROR: [CONFLICTING_OVERLOADS] Conflicting overloads: [/C.foo]
|
||||||
|
// ERROR: [CONFLICTING_OVERLOADS] Conflicting overloads: [/C.foo]
|
||||||
|
interface I {
|
||||||
|
open fun foo(){}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class A {
|
||||||
|
open fun foo(){}
|
||||||
|
}
|
||||||
|
|
||||||
|
class C : A(), I {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
<selection><caret>return super.equals(other)</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun foo() {
|
||||||
|
super<A>.foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun foo() {
|
||||||
|
super<I>.foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
return super.hashCode()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return super.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
import androidx.annotation.RecentlyNonNull
|
||||||
|
import androidx.annotation.RecentlyNullable
|
||||||
|
import foo.A
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
@RecentlyNonNull
|
||||||
|
override fun foo(@RecentlyNonNull s1: String, @RecentlyNullable s2: String?): String {
|
||||||
|
<selection><caret>return super.foo(s1, s2)</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
open class Base<A, B, C>() {
|
||||||
|
open val method : (A?) -> A = { it!! }
|
||||||
|
open fun foo(value : B) : B = value
|
||||||
|
open fun bar(value : () -> C) : (String) -> C = { value() }
|
||||||
|
}
|
||||||
|
|
||||||
|
class C : Base<String, C, Unit>() {
|
||||||
|
override fun bar(value: () -> Unit): (String) -> Unit {
|
||||||
|
<selection><caret>return super.bar(value)</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return super.equals(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun foo(value: C): C {
|
||||||
|
return super.foo(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
return super.hashCode()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val method: (String?) -> String
|
||||||
|
get() = method
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return super.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// COPY_DOC
|
// COPY_DOC
|
||||||
|
|
||||||
import foo.A
|
import foo.A
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// COPY_DOC
|
// COPY_DOC
|
||||||
|
|
||||||
import foo.A
|
import foo.A
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
@RequiresOptIn
|
@RequiresOptIn
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// COPY_DOC
|
// COPY_DOC
|
||||||
abstract class A {
|
abstract class A {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// COPY_DOC
|
// COPY_DOC
|
||||||
abstract class A {
|
abstract class A {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
data class Foo(val name: String) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
<selection><caret>return super.equals(other)</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun foo(a:Int = 1)
|
fun foo(a:Int = 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun foo(a:Int = 1)
|
fun foo(a:Int = 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun foo()
|
fun foo()
|
||||||
fun bar()
|
fun bar()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface T {
|
interface T {
|
||||||
fun foo()
|
fun foo()
|
||||||
fun bar()
|
fun bar()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
fun a(){}
|
fun a(){}
|
||||||
fun b(){}
|
fun b(){}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
fun a(){}
|
fun a(){}
|
||||||
fun b(){}
|
fun b(){}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A<T> {
|
open class A<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A<T> {
|
open class A<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// From KT-1254
|
// From KT-1254
|
||||||
interface T {
|
interface T {
|
||||||
fun Foo() : (String) -> Unit
|
fun Foo() : (String) -> Unit
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// From KT-1254
|
// From KT-1254
|
||||||
interface T {
|
interface T {
|
||||||
fun Foo() : (String) -> Unit
|
fun Foo() : (String) -> Unit
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum <caret>class Foo
|
enum <caret>class Foo
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum class Foo {
|
enum class Foo {
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum <caret>class Foo {
|
enum <caret>class Foo {
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum class Foo {
|
enum class Foo {
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum <caret>class Foo {
|
enum <caret>class Foo {
|
||||||
A
|
A
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum class Foo {
|
enum class Foo {
|
||||||
A;
|
A;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum <caret>class Foo {
|
enum <caret>class Foo {
|
||||||
A;
|
A;
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
enum class Foo {
|
enum class Foo {
|
||||||
A;
|
A;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
interface A
|
||||||
|
|
||||||
|
interface B : A {
|
||||||
|
override fun equals(other: Any?): Boolean<caret>
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun foo(`object` : Any): Int = 0
|
open fun foo(`object` : Any): Int = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun foo(`object` : Any): Int = 0
|
open fun foo(`object` : Any): Int = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// From KT-1254
|
// From KT-1254
|
||||||
interface T {
|
interface T {
|
||||||
fun Foo() : (String) -> Unit
|
fun Foo() : (String) -> Unit
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// From KT-1254
|
// From KT-1254
|
||||||
interface T {
|
interface T {
|
||||||
fun Foo() : (String) -> Unit
|
fun Foo() : (String) -> Unit
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// From KT-1648
|
||||||
|
interface A {
|
||||||
|
val method:() -> Unit?
|
||||||
|
}
|
||||||
|
|
||||||
|
fun some() : A {
|
||||||
|
return object : A {
|
||||||
|
override val method: () -> kotlin.Unit?
|
||||||
|
get() = <selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: need better selection and caret
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Trait {
|
interface Trait {
|
||||||
fun <A, B : Runnable, E : Map.Entry<A, B>> foo() where B : Cloneable, B : Comparable<B>
|
fun <A, B : Runnable, E : Map.Entry<A, B>> foo() where B : Cloneable, B : Comparable<B>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Trait {
|
interface Trait {
|
||||||
fun <A, B : Runnable, E : Map.Entry<A, B>> foo() where B : Cloneable, B : Comparable<B>
|
fun <A, B : Runnable, E : Map.Entry<A, B>> foo() where B : Cloneable, B : Comparable<B>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
package something
|
package something
|
||||||
|
|
||||||
interface Some<T> {
|
interface Some<T> {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
package something
|
package something
|
||||||
|
|
||||||
interface Some<T> {
|
interface Some<T> {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface G<T> {
|
interface G<T> {
|
||||||
fun foo(t : T) : T
|
fun foo(t : T) : T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface G<T> {
|
interface G<T> {
|
||||||
fun foo(t : T) : T
|
fun foo(t : T) : T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull
|
||||||
|
|
||||||
|
abstract class X : java.util.ArrayList<String>(), Runnable {
|
||||||
|
@NotNull
|
||||||
|
override fun iterator(): MutableIterator<String?> {
|
||||||
|
<selection><caret>return super.iterator()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// from KT-488
|
// from KT-488
|
||||||
|
|
||||||
class MyClass<A: Comparable<A>> : Iterable<A> {
|
class MyClass<A: Comparable<A>> : Iterable<A> {
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// from KT-488
|
// from KT-488
|
||||||
|
|
||||||
class MyClass<A: Comparable<A>> : Iterable<A> {
|
class MyClass<A: Comparable<A>> : Iterable<A> {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Runnable {
|
interface Runnable {
|
||||||
fun run()
|
fun run()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Runnable {
|
interface Runnable {
|
||||||
fun run()
|
fun run()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
interface A {
|
||||||
|
fun a1()
|
||||||
|
fun a2()
|
||||||
|
fun a3()
|
||||||
|
fun a4()
|
||||||
|
fun a5()
|
||||||
|
fun a6()
|
||||||
|
fun a7()
|
||||||
|
fun a8()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Test : A {
|
||||||
|
override fun a6() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a7() {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a8() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a1() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a2() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a3() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a4() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a5() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
interface A {
|
||||||
|
fun a1()
|
||||||
|
fun a2()
|
||||||
|
fun a3()
|
||||||
|
fun a4()
|
||||||
|
fun a5()
|
||||||
|
fun a6()
|
||||||
|
fun a7()
|
||||||
|
fun a8()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Test : A {
|
||||||
|
override fun a4() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a5() {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a6() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a7() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a8() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a1() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a2() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun a3() {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun a1()
|
fun a1()
|
||||||
fun a2()
|
fun a2()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
class C : (String) -> Boolean {
|
class C : (String) -> Boolean {
|
||||||
<caret>
|
<caret>
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
class C : (String) -> Boolean {
|
class C : (String) -> Boolean {
|
||||||
override fun invoke(p1: String): Boolean {
|
override fun invoke(p1: String): Boolean {
|
||||||
<selection><caret>TODO("Not yet implemented")</selection>
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// ERROR: Unexpected tokens
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
import foo.A
|
||||||
|
import foo.B
|
||||||
|
|
||||||
|
class C : A() {
|
||||||
|
override fun foo(x: (Mutable)List<String!>!, y: String!): B<String?>? {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
// ERROR: Unexpected token
|
||||||
|
package foo
|
||||||
|
|
||||||
|
class Impl: B {
|
||||||
|
override fun foo(r: Runnable!) {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
import foo.Intf
|
||||||
|
|
||||||
|
class Impl(): Intf {
|
||||||
|
override fun getFooBar(): String? {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
class <caret>Impl : TestJavaInterface {
|
class <caret>Impl : TestJavaInterface {
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
class Impl : TestJavaInterface {
|
class Impl : TestJavaInterface {
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
import foo.Intf
|
||||||
|
|
||||||
|
class Impl(): Intf() {
|
||||||
|
override fun getFooBar(): String? {
|
||||||
|
<selection><caret>return super.getFooBar()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
import foo.Intf
|
||||||
|
|
||||||
|
class Impl(): Intf() {
|
||||||
|
override fun getFooBar(): String? {
|
||||||
|
<selection><caret>return super.getFooBar()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// ERROR: Unexpected tokens
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
// ERROR: Unexpected token
|
||||||
|
import foo.Intf
|
||||||
|
|
||||||
|
class Impl(): Intf {
|
||||||
|
override fun fooBar(i: Int, s: Array<(out) String!>!, foo: Any!) {
|
||||||
|
<selection><caret>TODO("Not yet implemented")</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
import foo.A
|
||||||
|
import javax.annotation.Nonnull
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
@Nonnull
|
||||||
|
override fun foo(@Nonnull s: String): String {
|
||||||
|
<selection><caret>return super.foo(s)</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
import java.util.stream.Stream
|
||||||
|
|
||||||
|
abstract class A : List<String> {
|
||||||
|
override fun stream(): Stream<String?> {
|
||||||
|
<selection><caret>return super.stream()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
abstract class C<A> {
|
abstract class C<A> {
|
||||||
abstract fun f(a: A)
|
abstract fun f(a: A)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
abstract class C<A> {
|
abstract class C<A> {
|
||||||
abstract fun f(a: A)
|
abstract fun f(a: A)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun foo(value : String) : Int = 0
|
fun foo(value : String) : Int = 0
|
||||||
fun bar() : String = "hello"
|
fun bar() : String = "hello"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun foo(value : String) : Int = 0
|
fun foo(value : String) : Int = 0
|
||||||
fun bar() : String = "hello"
|
fun bar() : String = "hello"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun foo() {}
|
open fun foo() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun foo() {}
|
open fun foo() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface I {
|
interface I {
|
||||||
<caret>
|
<caret>
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface I {
|
interface I {
|
||||||
<caret>
|
<caret>
|
||||||
}
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// ERROR: Unexpected token
|
||||||
|
import foo.A
|
||||||
|
import org.jetbrains.annotations.Nullable
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
@Nullable
|
||||||
|
override fun foo(s: String!): String? {
|
||||||
|
<selection><caret>return super.foo(s)</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface IBase {
|
interface IBase {
|
||||||
fun foo(): Any?
|
fun foo(): Any?
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface IBase {
|
interface IBase {
|
||||||
fun foo(): Any?
|
fun foo(): Any?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun String.foo()
|
fun String.foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
fun String.foo()
|
fun String.foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun Int.foo(): Int {
|
open fun Int.foo(): Int {
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open fun Int.foo(): Int {
|
open fun Int.foo(): Int {
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
val String.prop : Int
|
val String.prop : Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A {
|
interface A {
|
||||||
val String.prop : Int
|
val String.prop : Int
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open external fun foo()
|
open external fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
open class A {
|
open class A {
|
||||||
open external fun foo()
|
open external fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Some {
|
interface Some {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Some {
|
interface Some {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Some {
|
interface Some {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface Some {
|
interface Some {
|
||||||
fun foo()
|
fun foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
interface Some {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Other {
|
||||||
|
fun test() {
|
||||||
|
val a = 1
|
||||||
|
}
|
||||||
|
fun otherTest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
<selection><caret>return super.equals(other)</selection>
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
return super.hashCode()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return super.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
open class A() {
|
||||||
|
open val method : () -> Unit? = {println("hello")}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun some() : A {
|
||||||
|
return object : A() {
|
||||||
|
override val method: () -> kotlin.Unit?
|
||||||
|
get() = <selection><caret>super.method</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: need better selection and caret
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
interface A<T> {
|
interface A<T> {
|
||||||
fun foo(value : T) : Unit = println(value)
|
fun foo(value : T) : Unit = println(value)
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user