[Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite
This commit is contained in:
committed by
TeamCityServer
parent
85949b387e
commit
cd890d5833
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: +UNUSED_EXPRESSION
|
||||
|
||||
fun unusedExpression(s: String) {
|
||||
s::hashCode
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: +UNUSED_EXPRESSION
|
||||
|
||||
fun unusedExpression(s: String) {
|
||||
<!UNUSED_EXPRESSION!>s::hashCode<!>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// MODULE: m1
|
||||
// FILE: bar.kt
|
||||
|
||||
fun <T> bar(<!UNUSED_PARAMETER!>ff<!>: <!UNRESOLVED_REFERENCE!>Err<!>.() -> Unit) {
|
||||
fun <T> bar(ff: <!UNRESOLVED_REFERENCE!>Err<!>.() -> Unit) {
|
||||
}
|
||||
|
||||
// MODULE: m2(m1)
|
||||
|
||||
Vendored
+1
-1
@@ -4,6 +4,6 @@ fun foo(x: Any, y: Int) = y
|
||||
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
|
||||
val fooRef: (Int, Any) -> Unit = ::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_VARIABLE
|
||||
fun foo(x: Int, <!UNUSED_PARAMETER!>y<!>: Any) = x
|
||||
fun foo(<!UNUSED_PARAMETER!>x<!>: Any, y: Int) = y
|
||||
fun foo(x: Int, y: Any) = x
|
||||
fun foo(x: Any, y: Int) = y
|
||||
|
||||
fun main() {
|
||||
::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
|
||||
val fooRef: (Int, Any) -> Unit = ::<!NONE_APPLICABLE!>foo<!>
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -16,6 +16,6 @@ fun test() {
|
||||
|
||||
Outer.Companion::Wrapper
|
||||
(Outer.Companion)::<!UNRESOLVED_REFERENCE!>Wrapper<!>
|
||||
<!UNUSED_EXPRESSION!>Outer::<!UNRESOLVED_REFERENCE!>Wrapper<!><!>
|
||||
Outer::<!UNRESOLVED_REFERENCE!>Wrapper<!>
|
||||
(Outer)::<!UNRESOLVED_REFERENCE!>Wrapper<!>
|
||||
}
|
||||
|
||||
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package first
|
||||
|
||||
import checkSubtype
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package other
|
||||
|
||||
import kotlin.reflect.*
|
||||
import checkSubtype
|
||||
import first.A
|
||||
|
||||
fun main() {
|
||||
val x = first.A::foo
|
||||
val y = first.A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KFunction1<A, Unit>>(x)
|
||||
checkSubtype<KFunction2<A, Int, Unit>>(y)
|
||||
checkSubtype<KFunction1<A, String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
@@ -7,7 +8,7 @@ import checkSubtype
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package first
|
||||
|
||||
import checkSubtype
|
||||
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package other
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
import first.foo
|
||||
import first.bar
|
||||
import first.baz
|
||||
import checkSubtype
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
@@ -6,7 +7,7 @@ package first
|
||||
import checkSubtype
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(x: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
val x = A::foo
|
||||
val y = A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KFunction1<A, Unit>>(x)
|
||||
checkSubtype<KFunction2<A, Int, Unit>>(y)
|
||||
checkSubtype<KFunction1<A, String>>(z)
|
||||
|
||||
checkSubtype<KFunction<Unit>>(x)
|
||||
checkSubtype<KFunction<Unit>>(y)
|
||||
checkSubtype<KFunction<String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
@@ -5,7 +6,7 @@ import kotlin.reflect.*
|
||||
class A
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun A.bar(x: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@ fun <T> foo() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>T::<!UNRESOLVED_REFERENCE!
|
||||
|
||||
fun <U : Any> bar() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>U::<!UNRESOLVED_REFERENCE!>toString<!><!>
|
||||
|
||||
fun take(<!UNUSED_PARAMETER!>arg<!>: Any) {}
|
||||
fun take(arg: Any) {}
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+4
-3
@@ -1,16 +1,17 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class B {
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
@@ -6,9 +7,9 @@ class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
|
||||
class B {
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class A {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
fun main() {
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+3
-2
@@ -1,12 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
|
||||
class A {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
Vendored
+3
-2
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
@@ -6,9 +7,9 @@ class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package a.b.c
|
||||
|
||||
class D<E, F> {
|
||||
fun foo(e: E, f: F) = this
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
import kotlin.reflect.KFunction3
|
||||
|
||||
fun main() {
|
||||
val x = a.b.c.D<String, Int>::foo
|
||||
|
||||
checkSubtype<KFunction3<a.b.c.D<String, Int>, String, Int, a.b.c.D<String, Int>>>(x)
|
||||
}
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package a.b.c
|
||||
|
||||
class D<E, F> {
|
||||
fun foo(<!UNUSED_PARAMETER!>e<!>: E, <!UNUSED_PARAMETER!>f<!>: F) = this
|
||||
fun foo(e: E, f: F) = this
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val x = A::foo
|
||||
val y = A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KFunction1<A, Unit>>(x)
|
||||
checkSubtype<KFunction2<A, Int, Unit>>(y)
|
||||
checkSubtype<KFunction1<A, String>>(z)
|
||||
|
||||
checkSubtype<KFunction<Unit>>(x)
|
||||
checkSubtype<KFunction<Unit>>(y)
|
||||
checkSubtype<KFunction<String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package other
|
||||
|
||||
fun foo() {}
|
||||
|
||||
class A {
|
||||
fun bar() = 42
|
||||
}
|
||||
|
||||
fun A.baz(x: String) {}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
import other.foo as foofoo
|
||||
import other.A as AA
|
||||
import other.baz as bazbaz
|
||||
|
||||
fun main() {
|
||||
val x = ::foofoo
|
||||
val y = AA::bar
|
||||
val z = AA::bazbaz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<AA, Int>>(y)
|
||||
checkSubtype<KFunction2<AA, String, Unit>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
@@ -9,7 +10,7 @@ class A {
|
||||
fun bar() = 42
|
||||
}
|
||||
|
||||
fun A.baz(<!UNUSED_PARAMETER!>x<!>: String) {}
|
||||
fun A.baz(x: String) {}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class A {
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class A {
|
||||
|
||||
Vendored
-19
@@ -1,19 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
@@ -5,7 +6,7 @@ import kotlin.reflect.*
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun A.main() {
|
||||
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class B {
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
Vendored
+2
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
@@ -5,7 +6,7 @@ import kotlin.reflect.*
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class B {
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun bar(x: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
class A
|
||||
|
||||
fun test1() {
|
||||
val <!UNUSED_VARIABLE!>foo<!> = ::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
val foo = ::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -2,10 +2,10 @@
|
||||
|
||||
class DTO {
|
||||
val q: Int = 0
|
||||
operator fun get(<!UNUSED_PARAMETER!>prop<!>: <!UNRESOLVED_REFERENCE!>KProperty1<!><*, Int>): Int = 0
|
||||
operator fun get(prop: <!UNRESOLVED_REFERENCE!>KProperty1<!><*, Int>): Int = 0
|
||||
}
|
||||
|
||||
fun foo(intDTO: DTO?, <!UNUSED_PARAMETER!>p<!>: <!UNRESOLVED_REFERENCE!>KProperty1<!><*, Int>) {
|
||||
fun foo(intDTO: DTO?, p: <!UNRESOLVED_REFERENCE!>KProperty1<!><*, Int>) {
|
||||
if (intDTO != null) {
|
||||
<!DEBUG_INFO_SMARTCAST!>intDTO<!>[DTO::q]
|
||||
<!DEBUG_INFO_SMARTCAST!>intDTO<!>.q
|
||||
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ var Int.meaning: Long
|
||||
|
||||
fun test() {
|
||||
val f = String::countCharacters
|
||||
|
||||
|
||||
checkSubtype<KProperty1<String, Int>>(f)
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KMutableProperty1<String, Int>>(f)
|
||||
checkSubtype<Int>(f.get("abc"))
|
||||
|
||||
+2
-2
@@ -7,11 +7,11 @@ val String.countCharacters: Int
|
||||
|
||||
var Int.meaning: Long
|
||||
get() = 42L
|
||||
set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||
set(value) {}
|
||||
|
||||
fun test() {
|
||||
val f = String::countCharacters
|
||||
|
||||
|
||||
checkSubtype<KProperty1<String, Int>>(f)
|
||||
checkSubtype<KMutableProperty1<String, Int>>(<!TYPE_MISMATCH!>f<!>)
|
||||
checkSubtype<Int>(f.get("abc"))
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// KT-12338 Compiler error ERROR: Rewrite at slice LEXICAL_SCOPE key: REFERENCE_EXPRESSION with when and function references
|
||||
|
||||
fun a() { }
|
||||
|
||||
fun test() {
|
||||
when {
|
||||
true -> ::a
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
// KT-12338 Compiler error ERROR: Rewrite at slice LEXICAL_SCOPE key: REFERENCE_EXPRESSION with when and function references
|
||||
|
||||
fun a() { }
|
||||
|
||||
fun test() {
|
||||
when {
|
||||
true -> <!UNUSED_EXPRESSION!>::a<!>
|
||||
true -> ::a
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -6,9 +6,9 @@ class Foo {
|
||||
operator fun <T> getValue(thisRef: Any?, property: KProperty<*>) = 1
|
||||
}
|
||||
|
||||
fun main(<!UNUSED_PARAMETER!>x<!>: Int) {
|
||||
fun main(x: Int) {
|
||||
val f = Foo()
|
||||
val a: Int
|
||||
<!UNRESOLVED_REFERENCE!>get<!>() = f.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getValue<!>(null, ::<!UNSUPPORTED!>x<!>) // no exception after fix
|
||||
<!UNRESOLVED_REFERENCE!>print<!>(<!UNINITIALIZED_VARIABLE!>a<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: +UNUSED_EXPRESSION
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: +UNUSED_EXPRESSION
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user