[kotlin:testdata] Cherry-pick testdata changes from kt-212-master

Included changes:
35616cdf5b0b1 [testdata] Temporary mute QuickFixMultiModuleTestGenerated $Other.testAddActualTo[Class|TopLevelMember]
942c262a49f7c [testdata] Update testdata for ContinuationStackTraceTestGenerated
dc605d52ad20c [testdata] Fix KotlinJpsBuildTestIncremental.testLanguageVersionChanged
a6d66837c7445 [testdata] [Ir]KotlinEvaluateExpression[With[IR]FragmentCompiler]TestGenerated
6866335cdcdbc [kotlin:testdata] Update test data for KotlinHighlightVisitorTestGenerated
cfe5fcbe6245a [kotlin:testdata] Removed MultiModuleHighlightingTest related to -Xexperimental compiler key
268506919a0f9 [kotlin:testdata] Do not store files into working directory during MultiModuleHighlightingTest
79a302dff7cff [kotlin:testdata] Remove outdated autogenerated files
4e0c2041598b2 [kotlin:testdata] Remove outdated DiagnosticMessageTestGenerated test
b1b14b30f2651 [kotlin:testdata] LocalInspectionTestGenerated: KTIJ-19621 & fix FIR ignore comments
38ddb660f231e [kotlin:testdata] Update testdata for IntentionTestGenerated
fec077041f9bd [kotlin:testdata] QuickFixMultiModuleTestGenerated$CreateActual.testValueClass
1536ea4479359 [kotlin:testdata] Update testdata in QuickFixTestGenerated
d2b29ca96369e [kotlin:testdata] KdocResolveTestGenerated: fix testData
0346e4c707c8d [kotlin:testdata] Update ProjectTemplateBuildFileGenerationTestGenerated testdata
2d72020988a3b [kotlin:testdata] MultiPlatformHighlightingTestGenerated.testJvmKotlinReferencesCommonKotlinThroughJavaDifferentJvmImpls
11446d9cceafd [kotlin:testdata] KotlinSSCountFilterTest.testMaxWhenConditionWithExpression
adb23244ba74c [kotlin:testdata] ReferenceResolveTestGenerated.testJavaParameter
5a2468edca8d1 [kotlin:testdata] Update the asm version in AsmVersionForJpsBuildTest
3d0bb0f9b944c [kotlin:testdata] Update testdata for HighlightingMetaInfoTestGenerated.testKotlinInjection
b74ff2b966fe2 [kotlin] Update testdata about find usages
6e0696a90adeb Enable JVM IR for stdlib/reflect/test libraries
5d4c65ab7df9c [kotlin:testdata] Fix test GradleKtsImportTest.testError
faa3a5e42cbd9 [kotlin, formatter] fix testData for kt-212-master
7d59be2d16a13 UAST: update tests (compiled kotlin.text.Regex)
a6666f1b6ef77 [kotlin] JvmSmartCompletionTestGenerated: update testData

GitOrigin-RevId: b67c98e262415c5cf410e2062b4a3879b08efab1
This commit is contained in:
Stanislav Erokhin
2022-01-22 11:09:58 +00:00
committed by intellij-monorepo-bot
parent 0c188018a3
commit cce7bbe656
81 changed files with 160 additions and 281 deletions
@@ -79,7 +79,7 @@ abstract class GradleKtsImportTest : KotlinGradleImportingTestCase() {
"$expectedErrorMessage error has not been reported among other errors: $errors",
buildScriptErrors.isNotEmpty()
)
checkConfiguration("build.gradle.kts")
}
}
class CompositeBuild2 : GradleKtsImportTest() {
@@ -234,48 +234,13 @@ open class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
checkHighlightingInProject()
}
fun testJvmExperimentalLibrary() {
val sources = listOf(File(testDataPath, getTestName(true) + "/lib"))
val extraOptions = listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xexperimental=lib.ExperimentalAPI"
)
val lib = KotlinCompilerStandalone(sources, options = extraOptions).compile()
module("usage").addLibrary(lib)
checkHighlightingInProject()
}
fun testJsExperimentalLibrary() {
val sources = listOf(File(testDataPath, getTestName(true) + "/lib"))
val extraOptions = listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xexperimental=lib.ExperimentalAPI"
)
val lib = KotlinCompilerStandalone(
sources,
platform = KotlinCompilerStandalone.Platform.JavaScript(MockLibraryFacility.MOCK_LIBRARY_NAME, "lib"),
options = extraOptions
).compile()
val usageModule = module("usage")
usageModule.makeJsModule()
usageModule.addLibrary(lib, kind = JSLibraryKind)
checkHighlightingInProject()
}
fun testResolutionAnchorsAndBuiltins() {
val jarForCompositeLibrary = KotlinCompilerStandalone(
sources = listOf(File("$testDataPath${getTestName(true)}/compositeLibraryPart")),
target = File("compositeLibraryPart")
sources = listOf(File("$testDataPath${getTestName(true)}/compositeLibraryPart"))
).compile()
val stdlibJarForCompositeLibrary = KotlinArtifacts.instance.kotlinStdlib
val jarForSourceDependentLibrary = KotlinCompilerStandalone(
sources = listOf(File("$testDataPath${getTestName(true)}/sourceDependentLibrary")),
target = File("sourceDependentLibrary")
sources = listOf(File("$testDataPath${getTestName(true)}/sourceDependentLibrary"))
).compile()
val dependencyModule = module("dependencyModule")
@@ -324,10 +289,4 @@ open class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
}
}
private fun Module.makeJsModule() {
setupKotlinFacet {
settings.compilerArguments = K2JSCompilerArguments()
settings.targetPlatform = JSLibraryKind.compilerPlatform
}
}
}
@@ -287,4 +287,9 @@ public class DiagnosticMessageTestGenerated extends AbstractDiagnosticMessageTes
public void testUrlRender() throws Exception {
runTest("testData/diagnosticMessage/urlRender.kt");
}
@TestMetadata("upperBoundViolatedInTypeAliasConstructorCall.kt")
public void testUpperBoundViolatedInTypeAliasConstructorCall() throws Exception {
runTest("testData/diagnosticMessage/upperBoundViolatedInTypeAliasConstructorCall.kt");
}
}
@@ -6,7 +6,7 @@ fun <T: Any, E> T.foo(<warning descr="[UNUSED_PARAMETER] Parameter 'x' is never
y plus 1
y + 1.0
this<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type T">?.</warning>minus<T>(this)
this<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type T. This expression will have nullable type in future releases">?.</warning>minus<T>(this)
return this
}
@@ -64,7 +64,7 @@ fun Int.foo() = this
command?.equals1(null)
val c = Command()
c<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type Command">?.</warning>equals2(null)
c<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type Command. This expression will have nullable type in future releases">?.</warning>equals2(null)
if (command == null) <warning descr="[UNUSED_EXPRESSION] The expression is unused">1</warning>
}
@@ -66,12 +66,12 @@ fun t5() : Int {
return 1
<warning>2</warning>
}
while (<warning>1 > 2</warning>)
while (<warning><warning>1 > 2</warning></warning>)
<warning>return 1</warning>
}
fun t6() : Int {
while (1 > 2) {
while (<warning>1 > 2</warning>) {
return 1
<warning>2</warning>
}
@@ -79,7 +79,7 @@ fun t6() : Int {
}
fun t6break() : Int {
while (1 > 2) {
while (<warning>1 > 2</warning>) {
break
<warning>2</warning>
}
@@ -27,7 +27,7 @@ fun nonExhaustiveNullable(c: Color?) = <error descr="[NO_ELSE_IN_WHEN] 'when' ex
}
fun whenOnEnum(c: Color) {
<warning descr="[NON_EXHAUSTIVE_WHEN] 'when' expression on enum is recommended to be exhaustive, add 'RED' branch or 'else' branch instead">when</warning>(c) {
<warning descr="[NON_EXHAUSTIVE_WHEN_STATEMENT] Non exhaustive 'when' statements on enum will be prohibited in 1.7, add 'RED' branch or 'else' branch instead">when</warning>(c) {
Color.BLUE -> {}
Color.GREEN -> {}
}
@@ -6,6 +6,6 @@ fun main(<warning descr="[UNUSED_PARAMETER] Parameter 'args' is never used">args
val command : Any = 1
command<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type Any">?.</warning>equals(null)
command<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type Any. This expression will have nullable type in future releases">?.</warning>equals(null)
command.equals(null)
}
@@ -1,5 +0,0 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: UNSUPPORTED_FEATURE
// LANGUAGE_VERSION: 1.0
suspend fun test() {}
@@ -1,3 +0,0 @@
<!-- urlRender1 -->
<html>
The feature "coroutines" is only available since language version 1.1 (see more <a href="https://kotlinlang.org/docs/diagnostics/experimental-coroutines">here</a>)</html>
@@ -1,4 +1,4 @@
Unclassified 11 val c = object : A() {}
Unclassified 13 val d = object : T() {}
Unclassified 6 val b = object : A() {}
Unclassified 8 open class T : A()
Unclassified 8 open class T : A()
@@ -1,7 +1,7 @@
[kotlinOverloadAndExtensionUsages.0.kt] Function call 13 x.foo(1, 2)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 27 foo(t)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 32 a.foo(1, "")
[kotlinOverloadAndExtensionUsages.0.kt] Function call 37 foo(t)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 41 foo(s)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 12 x.foo(1, 2)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 26 foo(t)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 31 a.foo(1, "")
[kotlinOverloadAndExtensionUsages.0.kt] Function call 36 foo(t)
[kotlinOverloadAndExtensionUsages.0.kt] Function call 40 foo(s)
[kotlinOverloadAndExtensionUsages.1.kt] Function call 11 a.foo(0, "")
[kotlinOverloadAndExtensionUsages.1.kt] Function call 3 super<A>.foo(t)
@@ -1,3 +1,3 @@
[kotlinPrivatePropertyUsages2.0.kt] Named argument 10 public class ServerEx() : Server(foo = "!") {
[kotlinPrivatePropertyUsages2.0.kt] Value read 7 open fun processRequest() = foo
[kotlinPrivatePropertyUsages2.0.kt] Named argument 9 public class ServerEx() : Server(foo = "!") {
[kotlinPrivatePropertyUsages2.0.kt] Value read 6 open fun processRequest() = foo
[kotlinPrivatePropertyUsages2.1.kt] Named argument 5 println(Server(foo = "!").foo)
@@ -1,3 +1,3 @@
[kotlinPropertyReadUsages.0.kt] Value read 14 return super<A>.foo
[kotlinPropertyReadUsages.0.kt] Value read 13 return super<A>.foo
[kotlinPropertyReadUsages.1.kt] Value read 11 println("b.foo = ${b.foo}")
[kotlinPropertyReadUsages.1.kt] Value read 7 println("a.foo = ${a.foo}")
@@ -1,3 +1,3 @@
[kotlinPropertyReadUsages2.0.kt] Value read 13 return super<A>.foo
[kotlinPropertyReadUsages2.0.kt] Value read 12 return super<A>.foo
[kotlinPropertyReadUsages2.1.kt] Value read 11 println("b.foo = ${b.foo}")
[kotlinPropertyReadUsages2.1.kt] Value read 7 println("a.foo = ${a.foo}")
@@ -1,5 +1,5 @@
[kotlinPropertyUsages.0.kt] Value read 14 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write 18 super<A>.foo = value
[kotlinPropertyUsages.0.kt] Value read 13 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write 17 super<A>.foo = value
[kotlinPropertyUsages.1.kt] Value read 11 println("b.foo = ${b.foo}")
[kotlinPropertyUsages.1.kt] Value read 7 println("a.foo = ${a.foo}")
[kotlinPropertyUsages.1.kt] Value write 10 b.foo = "b"
@@ -1,5 +1,5 @@
[kotlinPropertyUsages2.0.kt] Value read 12 return super<A>.foo
[kotlinPropertyUsages2.0.kt] Value write 16 super<A>.foo = value
[kotlinPropertyUsages2.0.kt] Value read 11 return super<A>.foo
[kotlinPropertyUsages2.0.kt] Value write 15 super<A>.foo = value
[kotlinPropertyUsages2.1.kt] Value read 11 println("b.foo = ${b.foo}")
[kotlinPropertyUsages2.1.kt] Value read 7 println("a.foo = ${a.foo}")
[kotlinPropertyUsages2.1.kt] Value write 10 b.foo = "b"
@@ -1,3 +1,3 @@
[kotlinPropertyWriteUsages.0.kt] Value write 19 super<A>.foo = value
[kotlinPropertyWriteUsages.0.kt] Value write 18 super<A>.foo = value
[kotlinPropertyWriteUsages.1.kt] Value write 10 b.foo = "b"
[kotlinPropertyWriteUsages.1.kt] Value write 6 a.foo = "a"
@@ -1,3 +1,3 @@
[kotlinPropertyWriteUsages2.0.kt] Value write 17 super<A>.foo = value
[kotlinPropertyWriteUsages2.0.kt] Value write 16 super<A>.foo = value
[kotlinPropertyWriteUsages2.1.kt] Value write 10 b.foo = "b"
[kotlinPropertyWriteUsages2.1.kt] Value write 6 a.foo = "a"
@@ -1,5 +1,5 @@
[kotlinPropertyUsages.0.kt] Value read (B) 16 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write (B) 20 super<A>.foo = value
[kotlinPropertyUsages.0.kt] Value read (B) 15 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write (B) 19 super<A>.foo = value
[kotlinPropertyUsages.1.kt] Value read (Client) 11 println("b.foo = ${b.foo}")
[kotlinPropertyUsages.1.kt] Value read (Client) 7 println("a.foo = ${a.foo}")
[kotlinPropertyUsages.1.kt] Value write (Client) 10 b.foo = "b"
@@ -1,5 +1,5 @@
[kotlinPropertyUsages.0.kt] Value read 15 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write 19 super<A>.foo = value
[kotlinPropertyUsages.0.kt] Value read 14 return super<A>.foo
[kotlinPropertyUsages.0.kt] Value write 18 super<A>.foo = value
[kotlinPropertyUsages.1.kt] Value read 11 println("b.foo = ${b.foo}")
[kotlinPropertyUsages.1.kt] Value read 7 println("a.foo = ${a.foo}")
[kotlinPropertyUsages.1.kt] Value write 10 b.foo = "b"
@@ -1 +1 @@
Function call 11 Foo(1).bar(1)
Function call 10 Foo(1).bar(1)
@@ -1,4 +1,4 @@
[LibraryFunctionUsages.0.kt] Callable reference 11 val f = ::foo
[LibraryFunctionUsages.0.kt] Function call 12 foo()
[LibraryFunctionUsages.0.kt] Callable reference 10 val f = ::foo
[LibraryFunctionUsages.0.kt] Function call 11 foo()
[library.kt] Callable reference 53 val f = ::foo
[library.kt] Function call 52 foo()
@@ -1,5 +1,5 @@
[LibraryMemberFunctionUsages.0.kt] Callable reference 12 val f = A::foo
[LibraryMemberFunctionUsages.0.kt] Function call 13 A().foo(1)
[LibraryMemberFunctionUsages.0.kt] Callable reference 11 val f = A::foo
[LibraryMemberFunctionUsages.0.kt] Function call 12 A().foo(1)
[LibraryMemberFunctionUsages.1.java] Unclassified 11 new A().foo(1);
[library.kt] Callable reference 61 val ff = A::foo
[library.kt] Function call 60 a.foo(2)
@@ -1,4 +1,4 @@
[LibraryNestedClassMemberFunctionUsages.0.kt] Callable reference 12 val f = A.T::bar
[LibraryNestedClassMemberFunctionUsages.0.kt] Function call 13 A.T().bar(1)
[LibraryNestedClassMemberFunctionUsages.0.kt] Callable reference 11 val f = A.T::bar
[LibraryNestedClassMemberFunctionUsages.0.kt] Function call 12 A.T().bar(1)
[library.kt] Callable reference 66 val fff = A.T::bar
[library.kt] Function call 65 t.bar(2)
@@ -1,4 +1,4 @@
[LibraryNestedClassPrimaryConstructorUsages.0.kt] New instance creation 19 val aa = A.T(1)
[LibraryNestedClassPrimaryConstructorUsages.0.kt] Supertype 15 class Y() : A.T(1)
[LibraryNestedClassPrimaryConstructorUsages.0.kt] New instance creation 18 val aa = A.T(1)
[LibraryNestedClassPrimaryConstructorUsages.0.kt] Supertype 14 class Y() : A.T(1)
[library.kt] New instance creation 63 val t = A.T(1)
[library.kt] Supertype 28 class V() : A.T(1)
@@ -1,5 +1,5 @@
[LibraryNestedClassSecondaryConstructorUsages.0.kt] New instance creation 18 val a: A.T = A.T()
[LibraryNestedClassSecondaryConstructorUsages.0.kt] Supertype 15 class Y() : A.T()
[LibraryNestedClassSecondaryConstructorUsages.0.kt] New instance creation 17 val a: A.T = A.T()
[LibraryNestedClassSecondaryConstructorUsages.0.kt] Supertype 14 class Y() : A.T()
[LibraryNestedClassSecondaryConstructorUsages.1.java] New instance creation 14 A.T a = new A.T();
[LibraryNestedClassSecondaryConstructorUsages.1.java] Unclassified 10 super();
[LibraryNestedClassSecondaryConstructorUsages.1.java] Unclassified 6 public J() {
@@ -1,8 +1,8 @@
[LibraryNestedClassUsages.0.kt] Local variable declaration 18 val a: A.T = A.T()
[LibraryNestedClassUsages.0.kt] New instance creation 18 val a: A.T = A.T()
[LibraryNestedClassUsages.0.kt] New instance creation 19 val aa = A.T(1)
[LibraryNestedClassUsages.0.kt] Supertype 11 class X : A.T {
[LibraryNestedClassUsages.0.kt] Supertype 15 class Y() : A.T(1)
[LibraryNestedClassUsages.0.kt] Local variable declaration 17 val a: A.T = A.T()
[LibraryNestedClassUsages.0.kt] New instance creation 17 val a: A.T = A.T()
[LibraryNestedClassUsages.0.kt] New instance creation 18 val aa = A.T(1)
[LibraryNestedClassUsages.0.kt] Supertype 10 class X : A.T {
[LibraryNestedClassUsages.0.kt] Supertype 14 class Y() : A.T(1)
[LibraryNestedClassUsages.1.java] Local variable declaration 11 A.T t = new A.T();
[LibraryNestedClassUsages.1.java] Local variable declaration 12 A.T tt = new A.T(1);
[LibraryNestedClassUsages.1.java] New instance creation 11 A.T t = new A.T();
@@ -1,4 +1,4 @@
[LibraryObjectUsages.0.kt] Value read 12 val o = O
[LibraryObjectUsages.0.kt] Value read 11 val o = O
[LibraryObjectUsages.1.java] Class static member access 7 O o = O.INSTANCE;
[LibraryObjectUsages.1.java] Local variable declaration 7 O o = O.INSTANCE;
[library.kt] Value read 55 val o = O
@@ -1,4 +1,4 @@
[LibraryPrimaryConstructorUsages.0.kt] New instance creation 19 val aa = A(1)
[LibraryPrimaryConstructorUsages.0.kt] Supertype 15 class Y() : A(1)
[LibraryPrimaryConstructorUsages.0.kt] New instance creation 18 val aa = A(1)
[LibraryPrimaryConstructorUsages.0.kt] Supertype 14 class Y() : A(1)
[library.kt] New instance creation 57 val a = A(1)
[library.kt] Supertype 27 class C() : A(1) {
@@ -1,5 +1,5 @@
[LibrarySecondaryConstructorUsages.0.kt] New instance creation 18 val a: A = A()
[LibrarySecondaryConstructorUsages.0.kt] Supertype 15 class Y() : A()
[LibrarySecondaryConstructorUsages.0.kt] New instance creation 17 val a: A = A()
[LibrarySecondaryConstructorUsages.0.kt] Supertype 14 class Y() : A()
[LibrarySecondaryConstructorUsages.1.java] New instance creation 14 A a = new A();
[LibrarySecondaryConstructorUsages.1.java] Unclassified 10 super();
[LibrarySecondaryConstructorUsages.1.java] Unclassified 6 public J() {
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
package language_injection
import org.intellij.lang.annotations.Language
@@ -1,6 +1,7 @@
// FIR_IDENTICAL
package language_injection
<!HIGHLIGHTING("textAttributesKey='KOTLIN_KEYWORD'")!>import<!> org.intellij.lang.annotations.<!HIGHLIGHTING("textAttributesKey='KOTLIN_ANNOTATION'")!>Language<!>
<!HIGHLIGHTING("textAttributesKey='KOTLIN_ANNOTATION'")!>@Language<!>("kotlin")
val <!HIGHLIGHTING("textAttributesKey='KOTLIN_PACKAGE_PROPERTY'")!>test<!> = "<!HIGHLIGHTING("severity='INJECTED_FRAGMENT'; textAttributesKey='kotlin:INJECTED_LANGUAGE_FRAGMENT'")!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'"), HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>fun<!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!> <!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>test2<!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>(<!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>)<!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!> <!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>{<!><!HIGHLIGHTING("severity='INJECTED_FRAGMENT_SYNTAX'; textAttributesKey='null'")!>}<!><!>"
val <!HIGHLIGHTING("textAttributesKey='KOTLIN_PACKAGE_PROPERTY'")!>test<!> = "fun test2() {}"
@@ -1,6 +0,0 @@
package language_injection
<!HIGHLIGHTING("textAttributesKey='KOTLIN_KEYWORD'")!>import<!> org.intellij.lang.annotations.<!HIGHLIGHTING("textAttributesKey='KOTLIN_ANNOTATION'")!>Language<!>
<!HIGHLIGHTING("textAttributesKey='KOTLIN_ANNOTATION'")!>@Language<!>("kotlin")
val <!HIGHLIGHTING("textAttributesKey='KOTLIN_PACKAGE_PROPERTY'")!>test<!> = "fun test2() {}"
@@ -1,5 +1,3 @@
private class Foo {
<caret>internal fun bar() {}
}
// IGNORE_FIR: KT-44939
}
@@ -1,5 +1,3 @@
private class Foo {
fun bar() {}
}
// IGNORE_FIR KT-44939
}
@@ -11,6 +11,4 @@ class C : A() {
fun main() {
val c = C()
c.attribute = "test"
}
// IGNORE_FIR: KT-44939
}
@@ -11,6 +11,4 @@ class C : A() {
fun main() {
val c = C()
c.attribute = "test"
}
// IGNORE_FIR KT-44939
}
@@ -15,6 +15,4 @@ class C : B() {
fun main() {
val c = C()
c.attribute = "test"
}
// IGNORE_FIR: KT-44939
}
@@ -15,6 +15,4 @@ class C : B() {
fun main() {
val c = C()
c.attribute = "test"
}
// IGNORE_FIR KT-44939
}
@@ -1,5 +1,7 @@
// PROBLEM: none
// WITH_STDLIB
// See KTIJ-19621
fun test(): Int = <caret>with("") {
println()
return 42
}
}
@@ -1,5 +0,0 @@
// WITH_STDLIB
fun test(): Int {
println()
return 42
}
@@ -1,3 +1,4 @@
// IGNORE_FIR
interface I1
interface I2
@@ -1,5 +1,6 @@
// IS_APPLICABLE: false
// WITH_STDLIB
@Target(AnnotationTarget.TYPE)
annotation class Foo(val value: String)
fun main() {
@@ -7,4 +7,4 @@ import java.io.File
fun f() {
}
// REF: (for File in kotlin.io).extension
// REF: (for java.io.File in kotlin.io).extension
@@ -1,8 +0,0 @@
package lib
@RequiresOptIn
annotation class ExperimentalAPI
class Foo
fun bar() {}
@@ -1,14 +0,0 @@
package usage
import lib.*
fun fail(foo: <error>Foo</error>): <error>Foo</error> {
<error>bar</error>()
return <error>foo</error>
}
@ExperimentalAPI
fun ok(foo: Foo): Foo {
bar()
return foo
}
@@ -1,8 +0,0 @@
package lib
@RequiresOptIn
annotation class ExperimentalAPI
class Foo
fun bar() {}
@@ -1,14 +0,0 @@
package usage
import lib.*
fun fail(foo: <error>Foo</error>): <error>Foo</error> {
<error>bar</error>()
return <error>foo</error>
}
@ExperimentalAPI
fun ok(foo: Foo): Foo {
bar()
return foo
}
@@ -11,5 +11,8 @@ a_jvm_id1 -> MOCK_JDK { kind=DEPENDENCY }
a_jvm_id2 -> a_common { kind=DEPENDS_ON }
a_jvm_id2 -> MOCK_JDK { kind=DEPENDENCY }
b_jvm -> a_jvm_id2 { kind=DEPENDENCY }
b_jvm -> MOCK_JDK { kind=DEPENDENCY }
c_jvm -> a_jvm_id1 { kind=DEPENDENCY }
c_jvm -> MOCK_JDK { kind=DEPENDENCY }
d_jvm -> a_jvm_id1 { kind=DEPENDENCY }
d_jvm -> MOCK_JDK { kind=DEPENDENCY }
@@ -1 +1,3 @@
// "Add 'actual' modifier" "false"
expect class Foo
@@ -1,3 +1,7 @@
// "Add 'actual' modifier" "true"
// "Add 'actual' modifier" "false"
// ACTION: Create test
// ACTION: Rename file to Foo.kt
// KTIJ-19789 No diagnostic "actual is missing" on top-level class/function/property in IDE
class <caret>Foo
@@ -1,3 +0,0 @@
// "Add 'actual' modifier" "true"
actual class Foo
@@ -1,3 +1,6 @@
// "Add 'actual' modifier" "true"
// "Add 'actual' modifier" "false"
// ACTION: Create test
// KTIJ-19789 No diagnostic "actual is missing" on top-level class/function/property in IDE
fun <caret>foo() {}
@@ -1,3 +0,0 @@
// "Add 'actual' modifier" "true"
actual fun foo() {}
@@ -1,6 +1,6 @@
// "Add initializer" "false"
// ACTION: Add setter
// ACTION: Change to val
// ACTION: Change to 'val'
// ACTION: Make internal
// ACTION: Make private
// ACTION: Make protected
@@ -9,4 +9,4 @@ class Bar {
fun test(foo: Foo?) {
foo?.bar?.invoke()
}
/* IGNORE_FIR */c
/* IGNORE_FIR */
@@ -6,7 +6,7 @@ interface A
operator fun A?.plus(a: A?): A? = this
fun test(a1: A, a2: A) {
a1 + a2?.let { notNull(it) }
(a1 + a2)?.let { notNull(it) }
}
fun notNull(t: A): A = t
@@ -1,7 +1,4 @@
// "Wrap with '?.let { ... }' call" "true"
// ERROR: Expression 'it' of type 'Unit' cannot be invoked as a function. The function 'invoke()' is not found
// ERROR: Function invocation 'foo2()' expected
// ERROR: Reference has a nullable type '(Str.() -> Unit)?', use explicit '?.invoke()' to make a function-like call instead
// WITH_RUNTIME
interface Str {
@@ -1,7 +1,4 @@
// "Wrap with '?.let { ... }' call" "true"
// ERROR: Expression 'it' of type 'Unit' cannot be invoked as a function. The function 'invoke()' is not found
// ERROR: Function invocation 'foo2()' expected
// ERROR: Reference has a nullable type '(Str.() -> Unit)?', use explicit '?.invoke()' to make a function-like call instead
// WITH_RUNTIME
interface Str {
@@ -12,7 +9,7 @@ object Str2 {
val foo2: (Str.() -> Unit)? = null
fun bar(s: Str) {
s.foo2?.let { it() }
foo2?.let { s.it() }
}
}
@@ -1,6 +1,6 @@
lateinit var x: java.lang.Readable
lateinit var y: java.nio.CharBuffer
val h = x.read(c<caret>b = y)
val h = x.read(p<caret>0 = y)
// REF: CharBuffer cb
// REF: CharBuffer var1
@@ -10,13 +10,13 @@ fun foo(): Int {
val x1 = when { else -> 1 }
val x2 = <warning descr="SSR">when {
1 < 2 -> 3
<warning>1 < 2</warning> -> 3
else -> 1
}</warning>
val x3 = when {
1 < 3 -> 1
2 > 1 -> 4
<warning>1 < 3</warning> -> 1
<warning>2 > 1</warning> -> 4
else -> 1
}
@@ -15,7 +15,7 @@ CoroutineInfo: -1 coroutine UNKNOWN
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$3 (kotlin.coroutines.intrinsics)
($i$a$-createCoroutineFromSuspendFunction-IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$2, it, result, this)
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame startCoroutine:!LINE_NUMBER!, ContinuationKt (kotlin.coroutines)
($this$startCoroutine, completion, receiver)
CoroutineStackFrame main:!LINE_NUMBER!, SuspendFunKt (coroutine1)
@@ -13,7 +13,7 @@ CoroutineInfo: 1 coroutine RUNNING
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, SuspendFunWithInnerKt$main$1 (continuation)
(rootCoroutineVal)
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame run:!LINE_NUMBER!, DispatchedTask (kotlinx.coroutines)
($i$a$-withCoroutineContext-DispatchedTask$run$1, $i$f$withCoroutineContext, context, continuation, countOrElement$iv, delegate, exception, fatalException, job, oldValue$iv, state, taskContext, this)
CoroutineStackFrame processNextEvent:!LINE_NUMBER!, EventLoopImplBase (kotlinx.coroutines)
@@ -9,7 +9,7 @@ Thread stack trace:
($result, $this$sequence, step, terms, this)
CoroutineInfo: -1 coroutine UNKNOWN
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame hasNext:!LINE_NUMBER!, SequenceBuilderIterator (kotlin.sequences)
(step, this)
CoroutineStackFrame hasNext:!LINE_NUMBER!, TakeSequence$iterator$1 (kotlin.sequences)
@@ -1,14 +0,0 @@
LineBreakpoint created at sourcePositionForGetterWithDiamondInterfaces.kt:22
Run Java
Connected to the target VM
sourcePositionForGetterWithDiamondInterfaces.kt:22
KotlinStackFrame (sourcePositionForGetterWithDiamondInterfaces.kt:22)
JavaValue[local] instance: sourcePositionForGetterWithDiamondInterfaces.TestClass = sourcePositionForGetterWithDiamondInterfaces.TestClass@hashCode (sourcePositionForGetterWithDiamondInterfaces.kt:20)
DummyMessageValueNode = No fields to display
JavaValue[getter] i2Int: int (sourcePositionForGetterWithDiamondInterfaces.kt:8)
JavaValue[getter] i3Int: int (sourcePositionForGetterWithDiamondInterfaces.kt:12)
JavaValue[getter] i1Int: int (sourcePositionForGetterWithDiamondInterfaces.kt:4)
Disconnected from the target VM
Process finished with exit code 0
@@ -3,7 +3,7 @@ package kt22366
fun main(args: Array<String>) {
val yy = (0 .. 10).map { a ->
//Breakpoint! (lambdaOrdinal = -1)
(0 .. 10).map { b -> b }.max()
(0 .. 10).map { b -> b }.maxOrNull()
}
}
@@ -1,7 +0,0 @@
LineBreakpoint created at inlineFunctionalExpression.kt:9
Run Java
Connected to the target VM
inlineFunctionalExpression.kt:9
Disconnected from the target VM
Process finished with exit code 0
@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JVM_WITH_IR_EVALUATOR
// IGNORE_BACKEND: JVM_WITH_IR_EVALUATOR, JVM_IR_WITH_IR_EVALUATOR
LineBreakpoint created at inlineFunctionalExpression.kt:9
Run Java
Connected to the target VM
@@ -13,7 +13,7 @@ CoroutineInfo: 1 coroutine RUNNING
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, CoroutineSuspendFunKt$main$1 (continuation)
($completion, c, paramB)
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame run:!LINE_NUMBER!, DispatchedTask (kotlinx.coroutines)
($i$a$-withCoroutineContext-DispatchedTask$run$1, $i$f$withCoroutineContext, context, continuation, countOrElement$iv, delegate, exception, fatalException, job, oldValue$iv, state, taskContext, this)
CoroutineStackFrame processNextEvent:!LINE_NUMBER!, EventLoopImplBase (kotlinx.coroutines)
@@ -13,7 +13,7 @@ CoroutineInfo: 1 coroutine RUNNING
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, CoroutineSuspendFun136Kt$main$1 (continuation)
($completion, c, paramB)
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame run:!LINE_NUMBER!, DispatchedTask (kotlinx.coroutines)
($i$a$-withCoroutineContext-DispatchedTask$run$1, $i$f$withCoroutineContext, context, continuation, countOrElement$iv, delegate, exception, fatalException, job, oldValue$iv, state, taskContext, this)
CoroutineStackFrame processNextEvent:!LINE_NUMBER!, EventLoopImplBase (kotlinx.coroutines)
@@ -15,7 +15,7 @@ CoroutineInfo: -1 coroutine UNKNOWN
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1 (kotlin.coroutines.intrinsics)
($i$a$-createCoroutineFromSuspendFunction-IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$1, it, result, this)
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$resumeWith_u24lambda_u2d0, completion, current, param, result, this)
CoroutineStackFrame startCoroutine:!LINE_NUMBER!, ContinuationKt (kotlin.coroutines)
($this$startCoroutine, completion)
CoroutineStackFrame runSuspend:!LINE_NUMBER!, RunSuspendKt (kotlin.coroutines.jvm.internal)
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:KOTLIN_VERSION')
classpath('com.android.tools.build:gradle:4.0.2')
classpath('com.android.tools.build:gradle:4.1.2')
}
}
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:KOTLIN_VERSION")
classpath("com.android.tools.build:gradle:4.0.2")
classpath("com.android.tools.build:gradle:4.1.2")
}
}
@@ -6,8 +6,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:KOTLIN_VERSION")
classpath("com.android.tools.build:gradle:4.0.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
classpath("com.android.tools.build:gradle:4.1.2")
}
}
@@ -9,6 +9,7 @@ version = '1.0-SNAPSHOT'
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven' }
}
kotlin {
@@ -40,8 +41,8 @@ kotlin {
}
jvmMain {
dependencies {
implementation 'io.ktor:ktor-server-netty:1.5.2'
implementation 'io.ktor:ktor-html-builder:1.5.2'
implementation 'io.ktor:ktor-server-netty:1.6.3'
implementation 'io.ktor:ktor-html-builder:1.6.3'
implementation 'org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2'
}
}
@@ -50,8 +51,8 @@ kotlin {
}
jsMain {
dependencies {
implementation 'org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.206-kotlin-1.5.10'
implementation 'org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.206-kotlin-1.5.10'
implementation 'org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.240-kotlin-1.5.30'
implementation 'org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.240-kotlin-1.5.30'
}
}
jsTest {
@@ -9,6 +9,7 @@ version = "1.0-SNAPSHOT"
repositories {
jcenter()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
kotlin {
@@ -38,16 +39,16 @@ kotlin {
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-server-netty:1.5.2")
implementation("io.ktor:ktor-html-builder:1.5.2")
implementation("io.ktor:ktor-server-netty:1.6.3")
implementation("io.ktor:ktor-html-builder:1.6.3")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.206-kotlin-1.5.10")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.206-kotlin-1.5.10")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.240-kotlin-1.5.30")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.240-kotlin-1.5.30")
}
}
val jsTest by getting
@@ -1,10 +1,38 @@
UClass (name = Regex)
UField (name = _options)
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
UField (name = nativePattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UField (name = Companion)
UAnnotation (fqName = null)
UField (name = nativePattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UField (name = _options)
UAnnotation (fqName = org.jetbrains.annotations.Nullable)
UMethod (name = Regex)
UParameter (name = nativePattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = option)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = options)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UMethod (name = getPattern)
UMethod (name = getOptions)
UMethod (name = matches)
@@ -62,59 +90,37 @@ UClass (name = Regex)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = limit)
UBlockExpression
UMethod (name = splitToSequence)
UParameter (name = input)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = limit)
UBlockExpression
UMethod (name = toString)
UBlockExpression
UMethod (name = toPattern)
UBlockExpression
UMethod (name = writeReplace)
UBlockExpression
UMethod (name = Regex)
UParameter (name = nativePattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = option)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UMethod (name = Regex)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = options)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UBlockExpression
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier ())
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
UClass (name = Serialized)
UField (name = Companion)
UAnnotation (fqName = null)
UField (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UField (name = flags)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UField (name = serialVersionUID)
UField (name = Companion)
UAnnotation (fqName = null)
UMethod (name = readResolve)
UBlockExpression
UMethod (name = getPattern)
UMethod (name = getFlags)
UMethod (name = Serialized)
UParameter (name = pattern)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
UParameter (name = flags)
UMethod (name = getPattern)
UMethod (name = getFlags)
UMethod (name = readResolve)
UBlockExpression
UClass (name = Companion)
UMethod (name = Companion)
UClass (name = Companion)
UMethod (name = Companion)
UMethod (name = fromLiteral)
UParameter (name = literal)
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
@@ -130,4 +136,3 @@ UClass (name = Regex)
UMethod (name = ensureUnicodeCase)
UParameter (name = flags)
UBlockExpression
UMethod (name = Companion)