[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
+6
-6
@@ -40,7 +40,7 @@ package MyPackage
|
||||
var l: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
var l1: Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>0<!>; <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(v: Int) {}
|
||||
|
||||
// FILE: c.kt
|
||||
//creating an instance
|
||||
@@ -52,10 +52,10 @@ abstract class B1(
|
||||
|
||||
class B2() : B1(1, "r") {}
|
||||
|
||||
abstract class B3(<!UNUSED_PARAMETER!>i<!>: Int) {
|
||||
abstract class B3(i: Int) {
|
||||
}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>c<!>: B3) {
|
||||
val <!UNUSED_VARIABLE!>a<!> = <!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>B3(1)<!>
|
||||
val <!UNUSED_VARIABLE!>b<!> = <!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>B1(2, "s")<!>
|
||||
}
|
||||
fun foo(c: B3) {
|
||||
val a = <!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>B3(1)<!>
|
||||
val b = <!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>B1(2, "s")<!>
|
||||
}
|
||||
|
||||
@@ -41,5 +41,5 @@ abstract class MyAbstractClass() {
|
||||
var l: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
var l1: Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>0<!>; <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
}
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(v: Int) {}
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,5 +41,5 @@ class MyClass() {
|
||||
var l: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
var l1: Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>0<!>; <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
}
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(v: Int) {}
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,5 +41,5 @@ interface MyTrait {
|
||||
var l: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
var l1: Int = <!PROPERTY_INITIALIZER_IN_INTERFACE!>0<!>; <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set
|
||||
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
}
|
||||
var n: Int <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(v: Int) {}
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@ interface NoC {
|
||||
class WithC() {
|
||||
val x : Int = 1
|
||||
init {
|
||||
val <!UNUSED_VARIABLE!>b<!> = x
|
||||
val b = x
|
||||
|
||||
}
|
||||
|
||||
val a : Int get() = 1
|
||||
|
||||
init {
|
||||
val <!UNUSED_VARIABLE!>z<!> = <!UNRESOLVED_REFERENCE!>b<!>
|
||||
val <!UNUSED_VARIABLE!>zz<!> = x
|
||||
val z = <!UNRESOLVED_REFERENCE!>b<!>
|
||||
val zz = x
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -3,9 +3,9 @@ fun text() {
|
||||
"direct:a" to "mock:a"
|
||||
"direct:a" on {it.body == "<hello/>"} to "mock:a"
|
||||
"direct:a" on {it -> it.body == "<hello/>"} to "mock:a"
|
||||
bar <!TYPE_MISMATCH!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!>1}<!>
|
||||
bar <!TYPE_MISMATCH!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!><!UNRESOLVED_REFERENCE!>it<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, DEBUG_INFO_MISSING_UNRESOLVED{NI}!>+<!> 1}<!>
|
||||
bar {it, <!UNUSED_ANONYMOUS_PARAMETER!>it1<!> -> it}
|
||||
bar <!TYPE_MISMATCH{NI}!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!>1}<!>
|
||||
bar <!TYPE_MISMATCH{NI}!><!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!><!UNRESOLVED_REFERENCE!>it<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, DEBUG_INFO_MISSING_UNRESOLVED{NI}!>+<!> 1}<!>
|
||||
bar {it, it1 -> it}
|
||||
|
||||
bar1 {1}
|
||||
bar1 {it + 1}
|
||||
@@ -13,21 +13,21 @@ fun text() {
|
||||
bar2 <!TYPE_MISMATCH{NI}!>{<!TYPE_MISMATCH!><!>}<!>
|
||||
bar2 {1}
|
||||
bar2 <!TYPE_MISMATCH{NI}!>{<!UNRESOLVED_REFERENCE!>it<!>}<!>
|
||||
bar2 <!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>it<!> -> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, TYPE_MISMATCH!>it<!>}<!>
|
||||
bar2 <!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>it<!> -> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, TYPE_MISMATCH{NI}!>it<!>}<!>
|
||||
}
|
||||
|
||||
fun bar(<!UNUSED_PARAMETER!>f<!> : (Int, Int) -> Int) {}
|
||||
fun bar1(<!UNUSED_PARAMETER!>f<!> : (Int) -> Int) {}
|
||||
fun bar2(<!UNUSED_PARAMETER!>f<!> : () -> Int) {}
|
||||
fun bar(f : (Int, Int) -> Int) {}
|
||||
fun bar1(f : (Int) -> Int) {}
|
||||
fun bar2(f : () -> Int) {}
|
||||
|
||||
infix fun String.to(<!UNUSED_PARAMETER!>dest<!> : String) {
|
||||
infix fun String.to(dest : String) {
|
||||
|
||||
}
|
||||
|
||||
infix fun String.on(<!UNUSED_PARAMETER!>predicate<!> : (s : URI) -> Boolean) : URI {
|
||||
infix fun String.on(predicate : (s : URI) -> Boolean) : URI {
|
||||
return URI(this)
|
||||
}
|
||||
|
||||
class URI(val body : Any) {
|
||||
infix fun to(<!UNUSED_PARAMETER!>dest<!> : String) {}
|
||||
infix fun to(dest : String) {}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo(<!UNUSED_PARAMETER!>u<!> : Unit) : Int = 1
|
||||
fun foo(u : Unit) : Int = 1
|
||||
|
||||
fun test() : Int {
|
||||
foo(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
val <!UNUSED_VARIABLE!>a<!> : () -> Unit = {
|
||||
val a : () -> Unit = {
|
||||
foo(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
}
|
||||
return 1 <!NONE_APPLICABLE!>-<!> "1"
|
||||
|
||||
@@ -26,7 +26,7 @@ fun f(): Unit {
|
||||
<!DEBUG_INFO_CONSTANT, TYPE_MISMATCH!>x<!> in 1..2
|
||||
|
||||
val y : Boolean? = true
|
||||
<!UNUSED_EXPRESSION!>false || <!TYPE_MISMATCH!>y<!><!>
|
||||
<!UNUSED_EXPRESSION!><!TYPE_MISMATCH!>y<!> && true<!>
|
||||
<!UNUSED_EXPRESSION!><!TYPE_MISMATCH!>y<!> && <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!><!>
|
||||
false || <!TYPE_MISMATCH!>y<!>
|
||||
<!TYPE_MISMATCH!>y<!> && true
|
||||
<!TYPE_MISMATCH!>y<!> && <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
|
||||
fun f (<!UNUSED_PARAMETER!>a<!> : Boolean, <!UNUSED_PARAMETER!>b<!> : Boolean) {
|
||||
fun f (a : Boolean, b : Boolean) {
|
||||
b@ while (true)
|
||||
<!REDUNDANT_LABEL_WARNING!>a@<!> {
|
||||
<!NOT_A_LOOP_LABEL!>break@f<!>
|
||||
@@ -25,7 +25,7 @@ class C {
|
||||
<!NOT_A_LOOP_LABEL!>break@f<!>
|
||||
}
|
||||
|
||||
fun containsBreak(a: String?, <!UNUSED_PARAMETER!>b<!>: String?) {
|
||||
fun containsBreak(a: String?, b: String?) {
|
||||
while (a == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun test() : Unit {
|
||||
checkSubtype<Int?>(x as? Int?)
|
||||
checkSubtype<Int?>(y as? Int?)
|
||||
|
||||
val <!UNUSED_VARIABLE!>s<!> = "" as Any
|
||||
val s = "" as Any
|
||||
("" as String?)?.length
|
||||
(<!REDUNDANT_LABEL_WARNING!>data@<!>("" as String?))?.length
|
||||
(<!WRONG_ANNOTATION_TARGET!>@MustBeDocumented()<!>( "" as String?))?.length
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun test(<!UNUSED_PARAMETER!>c<!> : Char) {
|
||||
fun test(c : Char) {
|
||||
test(<!EMPTY_CHARACTER_LITERAL!>''<!>)
|
||||
test('a')
|
||||
test(<!TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL!>'aa'<!>)
|
||||
|
||||
+3
-3
@@ -31,11 +31,11 @@ fun test() {
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><Double>(1)
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><Float>(1)
|
||||
|
||||
|
||||
1 as Byte
|
||||
1 as Int
|
||||
0xff as Long
|
||||
|
||||
|
||||
1.1 as Int
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><Int>(1.1)
|
||||
|
||||
@@ -50,4 +50,4 @@ fun test() {
|
||||
<!INAPPLICABLE_CANDIDATE!>testFun<!><Float>(1.0)
|
||||
testFun(1.0.toFloat())
|
||||
testFun<Float>(1.0.toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -12,7 +12,7 @@ fun varargFloat(vararg v: Float) = v
|
||||
|
||||
fun varargDouble(vararg v: Double) = v
|
||||
|
||||
fun <T> testFun(<!UNUSED_PARAMETER!>p<!>: T) {}
|
||||
fun <T> testFun(p: T) {}
|
||||
|
||||
fun test() {
|
||||
checkSubtype<Byte>(1)
|
||||
@@ -31,11 +31,11 @@ fun test() {
|
||||
|
||||
checkSubtype<Double>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
checkSubtype<Float>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
|
||||
|
||||
1 <!CAST_NEVER_SUCCEEDS!>as<!> Byte
|
||||
1 <!USELESS_CAST!>as Int<!>
|
||||
0xff <!CAST_NEVER_SUCCEEDS!>as<!> Long
|
||||
|
||||
|
||||
1.1 <!CAST_NEVER_SUCCEEDS!>as<!> Int
|
||||
checkSubtype<Int>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1.1<!>)
|
||||
|
||||
@@ -50,4 +50,4 @@ fun test() {
|
||||
testFun<Float>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1.0<!>)
|
||||
testFun(1.0.toFloat())
|
||||
testFun<Float>(1.0.toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@ class WithC2() : <!SUPERTYPE_NOT_INITIALIZED!>WithC1<!>
|
||||
class WithPC0() {
|
||||
}
|
||||
|
||||
class WithPC1(<!UNUSED_PARAMETER!>a<!> : Int) {
|
||||
class WithPC1(a : Int) {
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Foo() : <!FINAL_SUPERTYPE, SUPERTYPE_NOT_INITIALIZED!>WithPC0<!>, <!SYNTAX
|
||||
|
||||
}
|
||||
|
||||
class WithCPI_Dup(<!UNUSED_PARAMETER!>x<!> : Int) {
|
||||
class WithCPI_Dup(x : Int) {
|
||||
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>var x : Int<!>
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@ class NoCPI {
|
||||
val a = 1
|
||||
var ab = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>1<!>
|
||||
get() = 1
|
||||
set(<!UNUSED_PARAMETER!>v<!>) {}
|
||||
}
|
||||
set(v) {}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ abstract class Abst {
|
||||
abstract fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x)
|
||||
}
|
||||
|
||||
<!NON_MEMBER_FUNCTION_NO_BODY!>fun extraDiagnostics(<!UNUSED_PARAMETER!>x<!>: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int)<!>
|
||||
<!NON_MEMBER_FUNCTION_NO_BODY!>fun extraDiagnostics(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int)<!>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
val x = ""
|
||||
|
||||
fun bar(x : Int = <!TYPE_MISMATCH!>""<!>, y : Int = x, <!UNUSED_PARAMETER!>z<!> : String = <!TYPE_MISMATCH!>y<!>) {
|
||||
fun bar(x : Int = <!TYPE_MISMATCH!>""<!>, y : Int = x, z : String = <!TYPE_MISMATCH!>y<!>) {
|
||||
|
||||
}
|
||||
|
||||
// KT-371 Resolve default parameters for constructors
|
||||
|
||||
class A(x : Int = <!UNINITIALIZED_PARAMETER!>y<!>, y : Int = x) { // None of the references is resolved, no types checked
|
||||
fun foo(<!UNUSED_PARAMETER!>bool<!>: Boolean, a: Int = <!TYPE_MISMATCH, UNINITIALIZED_PARAMETER!>b<!>, b: String = <!TYPE_MISMATCH!>a<!>) {}
|
||||
fun foo(bool: Boolean, a: Int = <!TYPE_MISMATCH, UNINITIALIZED_PARAMETER!>b<!>, b: String = <!TYPE_MISMATCH!>a<!>) {}
|
||||
}
|
||||
|
||||
val z = 3
|
||||
|
||||
fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x, <!UNUSED_PARAMETER!>i<!> : Int = z): Int = x + y
|
||||
fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x, i : Int = z): Int = x + y
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
interface Base {
|
||||
var v : Int
|
||||
get() = 1
|
||||
set(v) {}
|
||||
}
|
||||
|
||||
open class Left() : Base
|
||||
|
||||
interface Right : Base
|
||||
|
||||
class Diamond() : Left(), Right
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Base {
|
||||
var v : Int
|
||||
get() = 1
|
||||
set(<!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(v) {}
|
||||
}
|
||||
|
||||
|
||||
open class Left() : Base
|
||||
|
||||
interface Right : Base
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun foo(<!UNUSED_PARAMETER!>a<!>: (String) -> Unit) {
|
||||
fun foo(a: (String) -> Unit) {
|
||||
"".<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ fun foo(<!UNUSED_PARAMETER!>a<!>: (String) -> Unit) {
|
||||
|
||||
interface A : (String) -> Unit {}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>a<!>: @ExtensionFunctionType A) {
|
||||
fun foo(a: @ExtensionFunctionType A) {
|
||||
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
|
||||
// Only kotlin.Function{n} type annotated with @Extension should
|
||||
"".<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
|
||||
@@ -40,8 +40,8 @@ fun main(args : Array<String>) {
|
||||
foo2()({})
|
||||
foo2()<!TOO_MANY_ARGUMENTS!>{}<!>
|
||||
(foo2()){}
|
||||
(foo2())<!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH, UNUSED_ANONYMOUS_PARAMETER!>x<!> -> }<!>
|
||||
foo2()(<!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH, UNUSED_ANONYMOUS_PARAMETER!>x<!> -> }<!>)
|
||||
(foo2())<!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x<!> -> }<!>
|
||||
foo2()(<!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>x<!> -> }<!>)
|
||||
|
||||
val a = fooT1(1)()
|
||||
checkSubtype<Int>(a)
|
||||
@@ -76,7 +76,7 @@ fun main1() {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
{<!UNUSED_ANONYMOUS_PARAMETER!>x<!> : Int -> 1}(<!NO_VALUE_FOR_PARAMETER!>)<!>;
|
||||
{x : Int -> 1}(<!NO_VALUE_FOR_PARAMETER!>)<!>;
|
||||
(fun Int.() = 1)(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
<!TYPE_MISMATCH{OI}!>"sd"<!>.<!FUNCTION_EXPECTED{NI}!>(fun Int.() = 1)<!>()
|
||||
val i : Int? = null
|
||||
|
||||
+23
-23
@@ -19,7 +19,7 @@ fun bbb() {
|
||||
return <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>
|
||||
}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>expr<!>: StringBuilder): Int {
|
||||
fun foo(expr: StringBuilder): Int {
|
||||
val c = 'a'
|
||||
when(c) {
|
||||
0.toChar() -> throw Exception("zero")
|
||||
@@ -37,7 +37,7 @@ fun intShortInfer() = 1
|
||||
fun intShort() : Int = 1
|
||||
//fun intBlockInfer() {1}
|
||||
fun intBlock() : Int {return 1}
|
||||
fun intBlock1() : Int {<!UNUSED_EXPRESSION!>1<!><!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun intBlock1() : Int {1<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
fun intString(): Int = <!TYPE_MISMATCH!>"s"<!>
|
||||
fun intFunctionLiteral(): Int = <!TYPE_MISMATCH_DUE_TO_EQUALS_LAMBDA_IN_FUN!>{ 10 }<!>
|
||||
@@ -48,7 +48,7 @@ fun blockReturnValueTypeMatch() : Int {return 1}
|
||||
fun blockReturnValueTypeMismatchUnit() : Int {return <!TYPE_MISMATCH!>Unit<!>}
|
||||
|
||||
fun blockAndAndMismatch() : Int {
|
||||
<!UNUSED_EXPRESSION!>true && false<!>
|
||||
true && false
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockAndAndMismatch1() : Int {
|
||||
return <!TYPE_MISMATCH!>true && false<!>
|
||||
@@ -58,7 +58,7 @@ fun blockAndAndMismatch2() : Int {
|
||||
}
|
||||
|
||||
fun blockAndAndMismatch3() : Int {
|
||||
<!UNUSED_EXPRESSION!>true || false<!>
|
||||
true || false
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockAndAndMismatch4() : Int {
|
||||
return <!TYPE_MISMATCH!>true || false<!>
|
||||
@@ -92,18 +92,18 @@ fun blockReturnValueTypeMatch6() : Int {
|
||||
}
|
||||
fun blockReturnValueTypeMatch7() : Int {
|
||||
if (1 > 2)
|
||||
<!UNUSED_EXPRESSION!>1.0<!>
|
||||
else <!UNUSED_EXPRESSION!>2.0<!>
|
||||
1.0
|
||||
else 2.0
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockReturnValueTypeMatch8() : Int {
|
||||
if (1 > 2)
|
||||
<!UNUSED_EXPRESSION!>1.0<!>
|
||||
else <!UNUSED_EXPRESSION!>2.0<!>
|
||||
1.0
|
||||
else 2.0
|
||||
return 1
|
||||
}
|
||||
fun blockReturnValueTypeMatch9() : Int {
|
||||
if (1 > 2)
|
||||
<!UNUSED_EXPRESSION!>1.0<!>
|
||||
1.0
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockReturnValueTypeMatch10() : Int {
|
||||
return <!TYPE_MISMATCH!><!INVALID_IF_AS_EXPRESSION!>if<!> (1 > 2)
|
||||
@@ -111,7 +111,7 @@ fun blockReturnValueTypeMatch10() : Int {
|
||||
}
|
||||
fun blockReturnValueTypeMatch11() : Int {
|
||||
if (1 > 2)
|
||||
else <!UNUSED_EXPRESSION!>1.0<!>
|
||||
else 1.0
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockReturnValueTypeMatch12() : Int {
|
||||
if (1 > 2)
|
||||
@@ -119,7 +119,7 @@ fun blockReturnValueTypeMatch12() : Int {
|
||||
else return <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1.0<!>
|
||||
}
|
||||
fun blockNoReturnIfValDeclaration(): Int {
|
||||
val <!UNUSED_VARIABLE!>x<!> = 1
|
||||
val x = 1
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
fun blockNoReturnIfEmptyIf(): Int {
|
||||
if (1 < 2) {} else {}
|
||||
@@ -171,37 +171,37 @@ class B() {
|
||||
}
|
||||
|
||||
fun testFunctionLiterals() {
|
||||
val <!UNUSED_VARIABLE!>endsWithVarDeclaration<!> : () -> Boolean = {
|
||||
<!EXPECTED_TYPE_MISMATCH!>val <!UNUSED_VARIABLE!>x<!> = 2<!>
|
||||
val endsWithVarDeclaration : () -> Boolean = {
|
||||
<!EXPECTED_TYPE_MISMATCH!>val x = 2<!>
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>endsWithAssignment<!>: () -> Int = {
|
||||
val endsWithAssignment: () -> Int = {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>x<!> = 1
|
||||
<!EXPECTED_TYPE_MISMATCH!><!UNUSED_VALUE!>x =<!> 333<!>
|
||||
<!EXPECTED_TYPE_MISMATCH!>x = 333<!>
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>endsWithReAssignment<!>: () -> Int = {
|
||||
val endsWithReAssignment: () -> Int = {
|
||||
var x = 1
|
||||
<!ASSIGNMENT_TYPE_MISMATCH!>x += 333<!>
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>endsWithFunDeclaration<!> : () -> String = {
|
||||
val endsWithFunDeclaration : () -> String = {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>x<!> = 1
|
||||
<!UNUSED_VALUE!>x =<!> 333
|
||||
x = 333
|
||||
<!EXPECTED_TYPE_MISMATCH!>fun meow() : Unit {}<!>
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>endsWithObjectDeclaration<!> : () -> Int = {
|
||||
val endsWithObjectDeclaration : () -> Int = {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>x<!> = 1
|
||||
<!UNUSED_VALUE!>x =<!> 333
|
||||
x = 333
|
||||
<!EXPECTED_TYPE_MISMATCH, LOCAL_OBJECT_NOT_ALLOWED!>object A<!> {}
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>expectedUnitReturnType1<!>: () -> Unit = {
|
||||
val <!UNUSED_VARIABLE!>x<!> = 1
|
||||
val expectedUnitReturnType1: () -> Unit = {
|
||||
val x = 1
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>expectedUnitReturnType2<!>: () -> Unit = {
|
||||
val expectedUnitReturnType2: () -> Unit = {
|
||||
fun meow() : Unit {}
|
||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object A<!> {}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
// A generic funciton is always less specific than a non-generic one
|
||||
fun <T> foo(t : T) : Unit {}
|
||||
fun foo(i : Int) : Int = 1
|
||||
|
||||
fun test() {
|
||||
checkSubtype<Int>(foo(1))
|
||||
checkSubtype<Unit>(foo("s"))
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
// A generic funciton is always less specific than a non-generic one
|
||||
fun <T> foo(<!UNUSED_PARAMETER!>t<!> : T) : Unit {}
|
||||
fun foo(<!UNUSED_PARAMETER!>i<!> : Int) : Int = 1
|
||||
fun <T> foo(t : T) : Unit {}
|
||||
fun foo(i : Int) : Int = 1
|
||||
|
||||
fun test() {
|
||||
checkSubtype<Int>(foo(1))
|
||||
|
||||
+6
-6
@@ -9,10 +9,10 @@ fun testIncDec() {
|
||||
++x
|
||||
x--
|
||||
--x
|
||||
x = <!UNUSED_CHANGED_VALUE!>x++<!>
|
||||
x = <!UNUSED_CHANGED_VALUE!>x--<!>
|
||||
x = x++
|
||||
x = x--
|
||||
x = ++x
|
||||
<!UNUSED_VALUE!>x =<!> --x
|
||||
x = --x
|
||||
}
|
||||
|
||||
class WrongIncDec() {
|
||||
@@ -39,8 +39,8 @@ fun testUnitIncDec() {
|
||||
<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>x
|
||||
x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>
|
||||
<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
x = <!UNUSED_CHANGED_VALUE!>x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!><!>
|
||||
x = <!UNUSED_CHANGED_VALUE!>x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!><!>
|
||||
x = x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>
|
||||
x = x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>x
|
||||
<!UNUSED_VALUE!>x =<!> <!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
}
|
||||
|
||||
@@ -2,36 +2,36 @@
|
||||
// KT-451 Incorrect character literals cause assertion failures
|
||||
|
||||
fun ff() {
|
||||
val <!UNUSED_VARIABLE!>b<!> = <!EMPTY_CHARACTER_LITERAL!>''<!>
|
||||
val <!UNUSED_VARIABLE!>c<!> = <!TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL!>'23'<!>
|
||||
val <!UNUSED_VARIABLE!>d<!> = <!INCORRECT_CHARACTER_LITERAL!>'a<!>
|
||||
val <!UNUSED_VARIABLE!>e<!> = <!INCORRECT_CHARACTER_LITERAL!>'ab<!>
|
||||
val <!UNUSED_VARIABLE!>f<!> = '<!ILLEGAL_ESCAPE!>\<!>'
|
||||
val b = <!EMPTY_CHARACTER_LITERAL!>''<!>
|
||||
val c = <!TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL!>'23'<!>
|
||||
val d = <!INCORRECT_CHARACTER_LITERAL!>'a<!>
|
||||
val e = <!INCORRECT_CHARACTER_LITERAL!>'ab<!>
|
||||
val f = '<!ILLEGAL_ESCAPE!>\<!>'
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<!UNUSED_EXPRESSION!>'a'<!>
|
||||
<!UNUSED_EXPRESSION!>'\n'<!>
|
||||
<!UNUSED_EXPRESSION!>'\t'<!>
|
||||
<!UNUSED_EXPRESSION!>'\b'<!>
|
||||
<!UNUSED_EXPRESSION!>'\r'<!>
|
||||
<!UNUSED_EXPRESSION!>'\"'<!>
|
||||
<!UNUSED_EXPRESSION!>'\''<!>
|
||||
<!UNUSED_EXPRESSION!>'\\'<!>
|
||||
<!UNUSED_EXPRESSION!>'\$'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\x<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\123<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\ra<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\000<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\000<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'\u0000'<!>
|
||||
<!UNUSED_EXPRESSION!>'\u000a'<!>
|
||||
<!UNUSED_EXPRESSION!>'\u000A'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\u<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\u0<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\u00<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\u000<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\u000z<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\\u000<!>'<!>
|
||||
<!UNUSED_EXPRESSION!>'<!ILLEGAL_ESCAPE!>\<!>'<!>
|
||||
'a'
|
||||
'\n'
|
||||
'\t'
|
||||
'\b'
|
||||
'\r'
|
||||
'\"'
|
||||
'\''
|
||||
'\\'
|
||||
'\$'
|
||||
'<!ILLEGAL_ESCAPE!>\x<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\123<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\ra<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\000<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\000<!>'
|
||||
'\u0000'
|
||||
'\u000a'
|
||||
'\u000A'
|
||||
'<!ILLEGAL_ESCAPE!>\u<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\u0<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\u00<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\u000<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\u000z<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\\u000<!>'
|
||||
'<!ILLEGAL_ESCAPE!>\<!>'
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun ff(<!UNUSED_PARAMETER!>a<!>: String) = 1
|
||||
fun ff(a: String) = 1
|
||||
|
||||
fun gg() {
|
||||
val a: String? = ""
|
||||
|
||||
+4
-4
@@ -8,11 +8,11 @@ class Example {
|
||||
infix fun Example.toExt(other: Example) = Pair(this, other)
|
||||
fun Example.toExtNonInfix(other: Example) = Pair(this, other)
|
||||
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.toExtWithExtraParams(other: Example, <!UNUSED_PARAMETER!>blah<!>: Int = 0) = Pair(this, other)
|
||||
fun Example.toExtNonInfixWithExtraParams(other: Example, <!UNUSED_PARAMETER!>blah<!>: Int = 0) = Pair(this, other)
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.toExtWithExtraParams(other: Example, blah: Int = 0) = Pair(this, other)
|
||||
fun Example.toExtNonInfixWithExtraParams(other: Example, blah: Int = 0) = Pair(this, other)
|
||||
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.toExtDefaultValues(other: Example? = null, <!UNUSED_PARAMETER!>blah<!>: Int = 0) = Pair(this, other)
|
||||
fun Example.toExtNonInfixDefaultValues(other: Example? = null, <!UNUSED_PARAMETER!>blah<!>: Int = 0) = Pair(this, other)
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.toExtDefaultValues(other: Example? = null, blah: Int = 0) = Pair(this, other)
|
||||
fun Example.toExtNonInfixDefaultValues(other: Example? = null, blah: Int = 0) = Pair(this, other)
|
||||
|
||||
fun Example.withLambda(f: () -> Unit) = Pair(this, f)
|
||||
|
||||
|
||||
+8
-8
@@ -7,7 +7,7 @@ open class B() {
|
||||
|
||||
class C() : B() {
|
||||
var x = 4
|
||||
fun foo(<!UNUSED_PARAMETER!>c<!>: C) {
|
||||
fun foo(c: C) {
|
||||
this.x = 34
|
||||
this.b = 123
|
||||
super.b = 23
|
||||
@@ -17,7 +17,7 @@ class C() : B() {
|
||||
<!VARIABLE_EXPECTED!>getInt()<!> = 12
|
||||
}
|
||||
|
||||
fun foo1(<!UNUSED_PARAMETER!>c<!>: C) {
|
||||
fun foo1(c: C) {
|
||||
<!VAL_REASSIGNMENT!>super.c<!> = 34
|
||||
}
|
||||
|
||||
@@ -51,18 +51,18 @@ fun cannotBe() {
|
||||
<!VARIABLE_EXPECTED!>5<!> = 34
|
||||
}
|
||||
|
||||
fun canBe(i0: Int, <!UNUSED_PARAMETER!>j<!>: Int) {
|
||||
fun canBe(i0: Int, j: Int) {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>i<!> = i0
|
||||
<!UNUSED_VALUE!>(label@ i) =<!> 34
|
||||
(label@ i) = 34
|
||||
|
||||
<!UNUSED_VALUE!>(label@ <!VAL_REASSIGNMENT!>j<!>) =<!> 34 //repeat for j
|
||||
(label@ <!VAL_REASSIGNMENT!>j<!>) = 34 //repeat for j
|
||||
|
||||
val a = A()
|
||||
(l@ a.a) = 3894
|
||||
}
|
||||
|
||||
fun canBe2(<!UNUSED_PARAMETER!>j<!>: Int) {
|
||||
<!UNUSED_VALUE!>(label@ <!VAL_REASSIGNMENT!>j<!>) =<!> 34
|
||||
fun canBe2(j: Int) {
|
||||
(label@ <!VAL_REASSIGNMENT!>j<!>) = 34
|
||||
}
|
||||
|
||||
class A() {
|
||||
@@ -107,7 +107,7 @@ class Test() {
|
||||
|
||||
a++
|
||||
(<!REDUNDANT_LABEL_WARNING!>l@<!> a)++
|
||||
<!UNUSED_CHANGED_VALUE!>(a)++<!>
|
||||
(a)++
|
||||
}
|
||||
|
||||
fun testVariables1() {
|
||||
|
||||
+58
-58
@@ -98,122 +98,122 @@ interface Example3 {
|
||||
|
||||
|
||||
|
||||
operator fun Example.plus(<!UNUSED_PARAMETER!>o<!>: Any): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.div(<!UNUSED_PARAMETER!>o<!>: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.plus(<!UNUSED_PARAMETER!>o<!>: Example, <!UNUSED_PARAMETER!>s<!>: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.minus(vararg <!UNUSED_PARAMETER!>o<!>: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.plus(o: Any): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.div(o: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.plus(o: Example, s: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.minus(vararg o: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.plus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.minus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.unaryPlus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.unaryMinus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.unaryPlus(<!UNUSED_PARAMETER!>s<!>: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.unaryMinus(<!UNUSED_PARAMETER!>o<!>: Example) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.unaryPlus(s: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.unaryMinus(o: Example) {}
|
||||
|
||||
operator fun Example.inc(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.dec(): Example? {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.plusAssign(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.minusAssign(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.divAssign(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>a<!>: String = "") {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.modAssign(vararg <!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
operator fun Example.plusAssign(n: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.minusAssign(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.divAssign(n: Int, a: String = "") {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.modAssign(vararg n: Int) {}
|
||||
|
||||
operator fun Example.compareTo(<!UNUSED_PARAMETER!>other<!>: Example): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.compareTo(other: Example): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.equals(<!UNUSED_PARAMETER!>a<!>: String): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.equals(a: String): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.contains(<!UNUSED_PARAMETER!>n<!>: Int): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.contains(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>s<!>: String = ""): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
operator fun Example.contains(n: Int): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.contains(n: Int, s: String = ""): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.invoke() {}
|
||||
|
||||
operator fun Example.get(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
operator fun Example.get(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int) {}
|
||||
operator fun Example.get(n: Int) {}
|
||||
operator fun Example.get(n: Int, n2: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.get() {}
|
||||
|
||||
operator fun Example.set(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
operator fun Example.set(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int, <!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
operator fun Example.set(n: Int, v: Int) {}
|
||||
operator fun Example.set(n: Int, n2: Int, v: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.set(v: Int) {}
|
||||
|
||||
operator fun Example.rangeTo(<!UNUSED_PARAMETER!>o<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.rangeTo(<!UNUSED_PARAMETER!>o<!>: Int, <!UNUSED_PARAMETER!>o2<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.rangeTo(vararg <!UNUSED_PARAMETER!>o<!>: String) {}
|
||||
operator fun Example.rangeTo(o: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.rangeTo(o: Int, o2: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.rangeTo(vararg o: String) {}
|
||||
|
||||
operator fun Example.component1(): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.component1(<!UNUSED_PARAMETER!>n<!>: Int): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.component1(n: Int): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.componentN(): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.iterator(): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.iterator(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.iterator(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.next(): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.next(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.next(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
operator fun Example.hasNext(): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.hasNext(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun Example.hasNext(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
infix fun Example.i1(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.i1(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.i1(vararg <!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
infix fun Example.i1(n: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.i1(n: Int, n2: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun Example.i1(vararg n: Int) {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plus(<!UNUSED_PARAMETER!>o<!>: String): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun div(<!UNUSED_PARAMETER!>o<!>: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plus(<!UNUSED_PARAMETER!>o<!>: Example, <!UNUSED_PARAMETER!>s<!>: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minus(vararg <!UNUSED_PARAMETER!>o<!>: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plus(o: String): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun div(o: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plus(o: Example, s: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minus(vararg o: Example): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryPlus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryMinus(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryPlus(<!UNUSED_PARAMETER!>s<!>: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryMinus(<!UNUSED_PARAMETER!>o<!>: Example) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryPlus(s: String = ""): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun unaryMinus(o: Example) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun inc(): Example {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun dec(): Example? {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plusAssign(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minusAssign(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun divAssign(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>a<!>: String = "") {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun modAssign(vararg <!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun plusAssign(n: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun minusAssign(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun divAssign(n: Int, a: String = "") {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun modAssign(vararg n: Int) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun compareTo(<!UNUSED_PARAMETER!>other<!>: Example): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun compareTo(other: Example): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun equals(<!UNUSED_PARAMETER!>a<!>: String): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun equals(a: String): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun contains(<!UNUSED_PARAMETER!>n<!>: Int): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun contains(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>s<!>: String = ""): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun contains(n: Int): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun contains(n: Int, s: String = ""): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun invoke() {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun get(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun get(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun get(n: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun get(n: Int, n2: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun get() {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int, <!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(<!UNUSED_PARAMETER!>v<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(n: Int, v: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(n: Int, n2: Int, v: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun set(v: Int) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(<!UNUSED_PARAMETER!>o<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(<!UNUSED_PARAMETER!>o<!>: Int, <!UNUSED_PARAMETER!>o2<!>: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(vararg <!UNUSED_PARAMETER!>o<!>: String) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(o: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(o: Int, o2: Int) {}
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun rangeTo(vararg o: String) {}
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun component1(): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun component1(<!UNUSED_PARAMETER!>n<!>: Int): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun component1(n: Int): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun componentN(): Int {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun iterator(): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun iterator(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun iterator(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun next(): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun next(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun next(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun hasNext(): Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun hasNext(<!UNUSED_PARAMETER!>n<!>: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun hasNext(n: Int): String {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(<!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(<!UNUSED_PARAMETER!>n<!>: Int, <!UNUSED_PARAMETER!>n2<!>: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(vararg <!UNUSED_PARAMETER!>n<!>: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(n: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(n: Int, n2: Int) {}
|
||||
<!INAPPLICABLE_INFIX_MODIFIER!>infix<!> fun i1(vararg n: Int) {}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
public interface ITest {
|
||||
public var prop : Int
|
||||
get() = 12
|
||||
set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
abstract class ATest {
|
||||
protected open var prop2 : Int
|
||||
get() = 13
|
||||
set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
class Test: ATest(), ITest {
|
||||
override var prop : Int
|
||||
get() = 12
|
||||
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>private<!> set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>private<!> set(value) {}
|
||||
|
||||
override var prop2 : Int
|
||||
get() = 14
|
||||
<!CANNOT_CHANGE_ACCESS_PRIVILEGE, SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>internal<!> set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||
<!CANNOT_CHANGE_ACCESS_PRIVILEGE, SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>internal<!> set(value) {}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
|
||||
@@ -62,9 +62,9 @@ interface E : A {
|
||||
override var a: Int
|
||||
get() = 0
|
||||
// Errors here and below
|
||||
<!PRIVATE_SETTER_FOR_OPEN_PROPERTY!>private<!> set(<!UNUSED_PARAMETER!>arg<!>) {}
|
||||
<!PRIVATE_SETTER_FOR_OPEN_PROPERTY!>private<!> set(arg) {}
|
||||
|
||||
override var b: Int
|
||||
get() = 0
|
||||
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE, PRIVATE_SETTER_FOR_OPEN_PROPERTY!>private<!> set(<!UNUSED_PARAMETER!>arg<!>) {}
|
||||
}
|
||||
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE, PRIVATE_SETTER_FOR_OPEN_PROPERTY!>private<!> set(arg) {}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ var x : Int = 1 + <!UNINITIALIZED_VARIABLE!>x<!>
|
||||
|
||||
val xx : Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>1 + x<!>
|
||||
get() : Int = 1
|
||||
<!VAL_WITH_SETTER!>set(<!UNUSED_PARAMETER!>value<!> : <!WRONG_SETTER_PARAMETER_TYPE!>Long<!>) {}<!>
|
||||
<!VAL_WITH_SETTER!>set(value : <!WRONG_SETTER_PARAMETER_TYPE!>Long<!>) {}<!>
|
||||
|
||||
val p : Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>1<!>
|
||||
get() = 1
|
||||
@@ -19,4 +19,4 @@ class Test() {
|
||||
set(x) {a = x; field = x}
|
||||
|
||||
public val i = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
package qualified_expressions
|
||||
|
||||
fun test(s: IntRange?) {
|
||||
val <!UNUSED_VARIABLE!>a<!>: Int = <!TYPE_MISMATCH!>s?.start<!>
|
||||
val a: Int = <!TYPE_MISMATCH!>s?.start<!>
|
||||
val b: Int? = s?.start
|
||||
val <!UNUSED_VARIABLE!>c<!>: Int = s?.start ?: -11
|
||||
val <!UNUSED_VARIABLE!>d<!>: Int = <!TYPE_MISMATCH{NI}!>s?.start ?: <!TYPE_MISMATCH{OI}!>"empty"<!><!>
|
||||
val c: Int = s?.start ?: -11
|
||||
val d: Int = <!TYPE_MISMATCH{NI}!>s?.start ?: <!TYPE_MISMATCH{OI}!>"empty"<!><!>
|
||||
val e: String = <!TYPE_MISMATCH{NI}!><!TYPE_MISMATCH{OI}!>s?.start<!> ?: "empty"<!>
|
||||
val <!UNUSED_VARIABLE!>f<!>: Int = s?.endInclusive ?: b ?: 1
|
||||
val <!UNUSED_VARIABLE!>g<!>: Boolean? = e.startsWith("s")//?.length
|
||||
val f: Int = s?.endInclusive ?: b ?: 1
|
||||
val g: Boolean? = e.startsWith("s")//?.length
|
||||
}
|
||||
|
||||
fun String.startsWith(<!UNUSED_PARAMETER!>s<!>: String): Boolean = true
|
||||
fun String.startsWith(s: String): Boolean = true
|
||||
|
||||
+11
-11
@@ -8,9 +8,9 @@ class Test(foo: Any?, bar: Any?) {
|
||||
private fun bas2(): Int = null!!
|
||||
|
||||
fun bar() = bar(1)
|
||||
fun bar(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
fun bar(i: Int) = 2
|
||||
private fun bar2() = bar2(1)
|
||||
private fun bar2(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
private fun bar2(i: Int) = 2
|
||||
}
|
||||
|
||||
// KT-6413 Typechecker recursive problem when class have non-invariant generic parameters
|
||||
@@ -24,9 +24,9 @@ class Test2<A, B, C>(foo: Any?, bar: Any?) {
|
||||
private fun bas2(): Int = null!!
|
||||
|
||||
fun bar() = bar(1)
|
||||
fun bar(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
fun bar(i: Int) = 2
|
||||
private fun bar2() = bar2(1)
|
||||
private fun bar2(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
private fun bar2(i: Int) = 2
|
||||
}
|
||||
|
||||
class Test3<in A, B, C>(foo: Any?, bar: Any?) {
|
||||
@@ -39,9 +39,9 @@ class Test3<in A, B, C>(foo: Any?, bar: Any?) {
|
||||
private fun bas2(): Int = null!!
|
||||
|
||||
fun bar() = bar(1)
|
||||
fun bar(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
fun bar(i: Int) = 2
|
||||
private fun bar2() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar2<!>(1)<!>
|
||||
private fun bar2(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
private fun bar2(i: Int) = 2
|
||||
}
|
||||
|
||||
class Test4<A, out B, C>(foo: Any?, bar: Any?) {
|
||||
@@ -54,9 +54,9 @@ class Test4<A, out B, C>(foo: Any?, bar: Any?) {
|
||||
private fun bas2(): Int = null!!
|
||||
|
||||
fun bar() = bar(1)
|
||||
fun bar(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
fun bar(i: Int) = 2
|
||||
private fun bar2() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar2<!>(1)<!>
|
||||
private fun bar2(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
private fun bar2(i: Int) = 2
|
||||
}
|
||||
|
||||
class Test5<A, out B, C>(foo: Any?, bar: Any?) {
|
||||
@@ -69,7 +69,7 @@ class Test5<A, out B, C>(foo: Any?, bar: Any?) {
|
||||
private fun bas2(): Int = null!!
|
||||
|
||||
fun bar() = bar(1)
|
||||
fun bar(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
fun bar(i: Int) = 2
|
||||
private fun bar2(): Int = bar2(1)
|
||||
private fun bar2(<!UNUSED_PARAMETER!>i<!>: Int) = 2
|
||||
}
|
||||
private fun bar2(i: Int) = 2
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// Fixpoint generic in Java: Enum<T extends Enum<T>>
|
||||
fun test(<!UNUSED_PARAMETER!>a<!> : java.lang.annotation.RetentionPolicy) {
|
||||
fun test(a : java.lang.annotation.RetentionPolicy) {
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
java.util.Collections.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>emptyList<!>()
|
||||
val <!UNUSED_VARIABLE!>a<!> : Collection<String>? = java.util.Collections.emptyList()
|
||||
val a : Collection<String>? = java.util.Collections.emptyList()
|
||||
}
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>a<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<Int><!>) {
|
||||
fun test(a : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<Int><!>) {
|
||||
|
||||
}
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>a<!> : java.util.ArrayList<Int>) {
|
||||
fun test(a : java.util.ArrayList<Int>) {
|
||||
|
||||
}
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>a<!> : java.lang.Class<Int>) {
|
||||
fun test(a : java.lang.Class<Int>) {
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -14,13 +14,13 @@ import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<!> as Com
|
||||
|
||||
val l : MutableList<in Int> = ArrayList<Int>()
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>l<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
|
||||
val <!UNUSED_VARIABLE!>x<!> : java.<!UNRESOLVED_REFERENCE!>List<!>
|
||||
val <!UNUSED_VARIABLE!>y<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>
|
||||
val <!UNUSED_VARIABLE!>b<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Object<!>
|
||||
val <!UNUSED_VARIABLE!>z<!> : java.<!UNRESOLVED_REFERENCE!>utils<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>List<!><Int>
|
||||
fun test(l : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
|
||||
val x : java.<!UNRESOLVED_REFERENCE!>List<!>
|
||||
val y : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>
|
||||
val b : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Object<!>
|
||||
val z : java.<!UNRESOLVED_REFERENCE!>utils<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>List<!><Int>
|
||||
|
||||
val <!UNUSED_VARIABLE!>f<!> : java.io.File? = null
|
||||
val f : java.io.File? = null
|
||||
|
||||
Collections.<!FUNCTION_CALL_EXPECTED, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>emptyList<!>
|
||||
Collections.<!FUNCTION_CALL_EXPECTED!>emptyList<Int><!>
|
||||
@@ -33,7 +33,7 @@ fun test(<!UNUSED_PARAMETER!>l<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util
|
||||
<!RESOLUTION_TO_CLASSIFIER!>List<!><Int>
|
||||
|
||||
|
||||
val <!UNUSED_VARIABLE!>o<!> = "sdf" as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>
|
||||
val o = "sdf" as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>
|
||||
|
||||
try {
|
||||
// ...
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun ff() {
|
||||
val i: Int = 1
|
||||
val <!UNUSED_VARIABLE!>a<!>: Int = i<!UNNECESSARY_SAFE_CALL!>?.<!>plus(2)
|
||||
val a: Int = i<!UNNECESSARY_SAFE_CALL!>?.<!>plus(2)
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import <!UNRESOLVED_REFERENCE!>com<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>unknown<!
|
||||
|
||||
fun ff() {
|
||||
val a = <!UNRESOLVED_REFERENCE!>unknown<!>()
|
||||
val <!UNUSED_VARIABLE!>b<!> = <!TYPE_MISMATCH{OI}!><!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>?.<!DEBUG_INFO_MISSING_UNRESOLVED!>plus<!>(42)<!>
|
||||
}
|
||||
val b = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>?.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, DEBUG_INFO_MISSING_UNRESOLVED{NI}!>plus<!>(42)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
fun use(<!UNUSED_PARAMETER!>s<!>: java.io.Serializable) {
|
||||
fun use(s: java.io.Serializable) {
|
||||
|
||||
}
|
||||
|
||||
fun useList(<!UNUSED_PARAMETER!>s<!>: List<java.io.Serializable>) {
|
||||
fun useList(s: List<java.io.Serializable>) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
fun <T> getT() {}
|
||||
fun <A, B> getTT() {}
|
||||
fun <A, B, C> getTTT(<!UNUSED_PARAMETER!>x<!> : Any) {}
|
||||
fun foo(<!UNUSED_PARAMETER!>a<!> : Any?) {}
|
||||
fun <A, B, C> getTTT(x : Any) {}
|
||||
fun foo(a : Any?) {}
|
||||
|
||||
public fun main() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}!>getT<!><<!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>>()
|
||||
|
||||
+9
-9
@@ -3,20 +3,20 @@ fun demo() {
|
||||
val a = ""
|
||||
val asd = 1
|
||||
val bar = 5
|
||||
fun map(<!UNUSED_PARAMETER!>f<!> : () -> Any?) : Int = 1
|
||||
fun buzz(<!UNUSED_PARAMETER!>f<!> : () -> Any?) : Int = 1
|
||||
fun map(f : () -> Any?) : Int = 1
|
||||
fun buzz(f : () -> Any?) : Int = 1
|
||||
val sdf = 1
|
||||
val foo = 3;
|
||||
<!UNUSED_EXPRESSION!>"$abc"<!>
|
||||
<!UNUSED_EXPRESSION!>"$"<!>
|
||||
<!UNUSED_EXPRESSION!>"$.$.asdf$\t"<!>
|
||||
<!UNUSED_EXPRESSION!>"asd\$"<!>
|
||||
<!UNUSED_EXPRESSION!>"asd$a<!ILLEGAL_ESCAPE!>\x<!>"<!>
|
||||
"$abc"
|
||||
"$"
|
||||
"$.$.asdf$\t"
|
||||
"asd\$"
|
||||
"asd$a<!ILLEGAL_ESCAPE!>\x<!>"
|
||||
"asd$a$asd$ $<!UNRESOLVED_REFERENCE!>xxx<!>"
|
||||
"fosdfasdo${1 + bar + 100}}sdsdfgdsfsdf"
|
||||
"foo${bar + map {foo}}sdfsdf"
|
||||
"foo${bar + map { "foo" }}sdfsdf"
|
||||
"foo${bar + map {
|
||||
"foo$sdf${ buzz{}}" }}sdfsdf"
|
||||
<!UNUSED_EXPRESSION!>"a<!ILLEGAL_ESCAPE!>\u<!> <!ILLEGAL_ESCAPE!>\u<!>0 <!ILLEGAL_ESCAPE!>\u<!>00 <!ILLEGAL_ESCAPE!>\u<!>000 \u0000 \u0AaA <!ILLEGAL_ESCAPE!>\u<!>0AAz.length( ) + \u0022b"<!>
|
||||
}
|
||||
"a<!ILLEGAL_ESCAPE!>\u<!> <!ILLEGAL_ESCAPE!>\u<!>0 <!ILLEGAL_ESCAPE!>\u<!>00 <!ILLEGAL_ESCAPE!>\u<!>000 \u0000 \u0AaA <!ILLEGAL_ESCAPE!>\u<!>0AAz.length( ) + \u0022b"
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ interface T1<!CONSTRUCTOR_IN_INTERFACE!>(val x: String)<!> {}
|
||||
|
||||
interface T2 <!CONSTRUCTOR_IN_INTERFACE!>constructor()<!> {}
|
||||
|
||||
interface T3 private <!CONSTRUCTOR_IN_INTERFACE!>constructor(<!UNUSED_PARAMETER!>a<!>: Int)<!> {}
|
||||
interface T3 private <!CONSTRUCTOR_IN_INTERFACE!>constructor(a: Int)<!> {}
|
||||
|
||||
interface T4 {
|
||||
<!CONSTRUCTOR_IN_INTERFACE!>constructor(<!UNUSED_PARAMETER!>a<!>: Int)<!> {
|
||||
val <!UNUSED_VARIABLE!>b<!>: Int = 1
|
||||
<!CONSTRUCTOR_IN_INTERFACE!>constructor(a: Int)<!> {
|
||||
val b: Int = 1
|
||||
}
|
||||
}
|
||||
|
||||
interface T5 private <!CONSTRUCTOR_IN_INTERFACE!>()<!> : T4 {}
|
||||
interface T6 <!CONSTRUCTOR_IN_INTERFACE!>private<!><!SYNTAX!><!> : T5 {}
|
||||
interface T6 <!CONSTRUCTOR_IN_INTERFACE!>private<!><!SYNTAX!><!> : T5 {}
|
||||
|
||||
+9
-9
@@ -3,17 +3,17 @@ class C<T>() {
|
||||
fun foo() : T {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>c<!>: C<Int>) {}
|
||||
fun foo(c: C<Int>) {}
|
||||
fun <T> bar() : C<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
|
||||
fun main() {
|
||||
val <!UNUSED_VARIABLE!>a<!> : C<Int> = C();
|
||||
val <!UNUSED_VARIABLE!>x<!> : C<in String> = C()
|
||||
val <!UNUSED_VARIABLE!>y<!> : C<out String> = C()
|
||||
val <!UNUSED_VARIABLE!>z<!> : C<*> = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>C<!>()
|
||||
val a : C<Int> = C();
|
||||
val x : C<in String> = C()
|
||||
val y : C<out String> = C()
|
||||
val z : C<*> = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>C<!>()
|
||||
|
||||
val <!UNUSED_VARIABLE!>ba<!> : C<Int> = bar();
|
||||
val <!UNUSED_VARIABLE!>bx<!> : C<in String> = bar()
|
||||
val <!UNUSED_VARIABLE!>by<!> : C<out String> = bar()
|
||||
val <!UNUSED_VARIABLE!>bz<!> : C<*> = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>bar<!>()
|
||||
val ba : C<Int> = bar();
|
||||
val bx : C<in String> = bar()
|
||||
val by : C<out String> = bar()
|
||||
val bz : C<*> = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>bar<!>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,13 +8,13 @@ class <!UNDERSCORE_IS_RESERVED!>_<!><<!UNDERSCORE_IS_RESERVED!>________<!>>
|
||||
val <!UNDERSCORE_IS_RESERVED!>______<!> = <!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>_<!><Int>()
|
||||
|
||||
fun <!UNDERSCORE_IS_RESERVED!>__<!>(<!UNDERSCORE_IS_RESERVED!>___<!>: Int, y: <!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>_<!><Int>?): Int {
|
||||
val (_, <!UNUSED_VARIABLE!>z<!>) = Pair(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>___<!> - 1, 42)
|
||||
val (_, z) = Pair(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>___<!> - 1, 42)
|
||||
val (x, <!UNDERSCORE_IS_RESERVED!>__________<!>) = Pair(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>___<!> - 1, 42)
|
||||
val <!UNDERSCORE_IS_RESERVED!>____<!> = x
|
||||
// in backquotes: allowed
|
||||
val `_` = <!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>__________<!>
|
||||
|
||||
val q = fun(_: Int, <!UNDERSCORE_IS_RESERVED, UNUSED_ANONYMOUS_PARAMETER!>__<!>: Int) {}
|
||||
val q = fun(_: Int, <!UNDERSCORE_IS_RESERVED!>__<!>: Int) {}
|
||||
q(1, 2)
|
||||
|
||||
val <!UNDERSCORE_IS_RESERVED!>_<!> = 56
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
fun foo(f : () -> Unit) {
|
||||
val x : Unit = f()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
fun foo(f : () -> Unit) {
|
||||
val <!UNUSED_VARIABLE!>x<!> : Unit = f()
|
||||
val x : Unit = f()
|
||||
}
|
||||
|
||||
+4
-4
@@ -3,13 +3,13 @@ package unresolved
|
||||
class Pair<A, B>(val a: A, val b: B)
|
||||
|
||||
fun testGenericArgumentsCount() {
|
||||
val <!UNUSED_VARIABLE!>p1<!>: Pair<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!> = Pair(2, 2)
|
||||
val <!UNUSED_VARIABLE!>p2<!>: <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Pair<!> = Pair(2, 2)
|
||||
val p1: Pair<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!> = Pair(2, 2)
|
||||
val p2: <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Pair<!> = Pair(2, 2)
|
||||
}
|
||||
|
||||
fun testUnresolved() {
|
||||
if (<!UNRESOLVED_REFERENCE!>a<!> is String) {
|
||||
val <!UNUSED_VARIABLE!>s<!> = <!UNRESOLVED_REFERENCE!>a<!>
|
||||
val s = <!UNRESOLVED_REFERENCE!>a<!>
|
||||
}
|
||||
<!UNRESOLVED_REFERENCE!>foo<!>(<!UNRESOLVED_REFERENCE!>a<!>)
|
||||
val s = "s"
|
||||
@@ -29,4 +29,4 @@ fun testUnresolved() {
|
||||
}
|
||||
}
|
||||
|
||||
fun foo1(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
||||
fun foo1(i: Int) {}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// !DIAGNOSTICS: +UNUSED_VARIABLE
|
||||
|
||||
data class D(val x: Int, val y: Int, val z: Int)
|
||||
fun foo(): Int {
|
||||
val (x, y, z) = D(1, 2, 3)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_VARIABLE
|
||||
// !DIAGNOSTICS: +UNUSED_VARIABLE
|
||||
|
||||
data class D(val x: Int, val y: Int, val z: Int)
|
||||
fun foo(): Int {
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class C(a: Int, b: Int, c: Int, d: Int, e: Int = d, val f: String) {
|
||||
init {
|
||||
a + a
|
||||
}
|
||||
|
||||
val g = b
|
||||
|
||||
init {
|
||||
c + c
|
||||
}
|
||||
}
|
||||
|
||||
fun f(a: Int, b: Int, c: Int = b) {
|
||||
a + a
|
||||
}
|
||||
|
||||
fun Any.getValue(thisRef: Any?, prop: KProperty<*>): String = ":)"
|
||||
fun Any.setValue(thisRef: Any?, prop: KProperty<*>, value: String) {
|
||||
}
|
||||
|
||||
fun Any.provideDelegate(thisRef: Any?, prop: KProperty<*>) {
|
||||
}
|
||||
|
||||
operator fun Int.getValue(thisRef: Any?, prop: KProperty<*>): String = ":)"
|
||||
|
||||
operator fun Int.setValue(thisRef: Any?, prop: KProperty<*>, value: String) {
|
||||
}
|
||||
|
||||
operator fun Int.provideDelegate(thisRef: Any?, prop: KProperty<*>) {
|
||||
}
|
||||
|
||||
|
||||
fun get(p: Any) {
|
||||
}
|
||||
|
||||
fun set(p: Any) {
|
||||
}
|
||||
|
||||
fun foo(s: String) {
|
||||
s.<!UNRESOLVED_REFERENCE!>xxx<!> = 1
|
||||
}
|
||||
+9
-8
@@ -1,6 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class C(a: Int, b: Int, c: Int, d: Int, <!UNUSED_PARAMETER!>e<!>: Int = d, val f: String) {
|
||||
class C(a: Int, b: Int, c: Int, d: Int, e: Int = d, val f: String) {
|
||||
init {
|
||||
a + a
|
||||
}
|
||||
@@ -12,15 +13,15 @@ class C(a: Int, b: Int, c: Int, d: Int, <!UNUSED_PARAMETER!>e<!>: Int = d, val f
|
||||
}
|
||||
}
|
||||
|
||||
fun f(a: Int, b: Int, <!UNUSED_PARAMETER!>c<!>: Int = b) {
|
||||
fun f(a: Int, b: Int, c: Int = b) {
|
||||
a + a
|
||||
}
|
||||
|
||||
fun Any.getValue(<!UNUSED_PARAMETER!>thisRef<!>: Any?, <!UNUSED_PARAMETER!>prop<!>: KProperty<*>): String = ":)"
|
||||
fun Any.setValue(<!UNUSED_PARAMETER!>thisRef<!>: Any?, <!UNUSED_PARAMETER!>prop<!>: KProperty<*>, <!UNUSED_PARAMETER!>value<!>: String) {
|
||||
fun Any.getValue(thisRef: Any?, prop: KProperty<*>): String = ":)"
|
||||
fun Any.setValue(thisRef: Any?, prop: KProperty<*>, value: String) {
|
||||
}
|
||||
|
||||
fun Any.provideDelegate(<!UNUSED_PARAMETER!>thisRef<!>: Any?, <!UNUSED_PARAMETER!>prop<!>: KProperty<*>) {
|
||||
fun Any.provideDelegate(thisRef: Any?, prop: KProperty<*>) {
|
||||
}
|
||||
|
||||
operator fun Int.getValue(thisRef: Any?, prop: KProperty<*>): String = ":)"
|
||||
@@ -32,12 +33,12 @@ operator fun Int.provideDelegate(thisRef: Any?, prop: KProperty<*>) {
|
||||
}
|
||||
|
||||
|
||||
fun get(<!UNUSED_PARAMETER!>p<!>: Any) {
|
||||
fun get(p: Any) {
|
||||
}
|
||||
|
||||
fun set(<!UNUSED_PARAMETER!>p<!>: Any) {
|
||||
fun set(p: Any) {
|
||||
}
|
||||
|
||||
fun foo(s: String) {
|
||||
s.<!UNRESOLVED_REFERENCE!>xxx<!> = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// !DIAGNOSTICS: +UNUSED_VALUE, +UNUSED_CHANGED_VALUE, +UNUSED_PARAMETER, +UNUSED_VARIABLE
|
||||
|
||||
package unused_variables
|
||||
|
||||
fun testSimpleCases() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSICS: +UNUSED_VALUE, +UNUSED_CHANGED_VALUE, +UNUSED_PARAMETER, UNUSED_VARIABLE
|
||||
// !DIAGNOSTICS: +UNUSED_VALUE, +UNUSED_CHANGED_VALUE, +UNUSED_PARAMETER, +UNUSED_VARIABLE
|
||||
|
||||
package unused_variables
|
||||
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
fun v(<!UNUSED_PARAMETER!>x<!> : Int, <!UNUSED_PARAMETER!>y<!> : String, vararg <!UNUSED_PARAMETER!>f<!> : Long) {}
|
||||
fun v1(vararg <!UNUSED_PARAMETER!>f<!> : (Int) -> Unit) {}
|
||||
fun v(x : Int, y : String, vararg f : Long) {}
|
||||
fun v1(vararg f : (Int) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
v(1, "")
|
||||
@@ -11,7 +11,7 @@ fun test() {
|
||||
v1({})
|
||||
v1({}, {})
|
||||
v1({}, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, {})
|
||||
v1({}, {}, {<!UNUSED_EXPRESSION!>it<!>})
|
||||
v1({}, {}, {it})
|
||||
v1({}) <!VARARG_OUTSIDE_PARENTHESES!>{}<!>
|
||||
v1 <!VARARG_OUTSIDE_PARENTHESES!>{}<!>
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -9,28 +9,28 @@ abstract class Usual<T> {}
|
||||
|
||||
fun foo(c: Consumer<Int>, p: Producer<Int>, u: Usual<Int>) {
|
||||
val c1: Consumer<Any> = <!TYPE_MISMATCH!>c<!>
|
||||
val <!UNUSED_VARIABLE!>c2<!>: Consumer<Int> = c1
|
||||
val c2: Consumer<Int> = c1
|
||||
|
||||
val p1: Producer<Any> = p
|
||||
val <!UNUSED_VARIABLE!>p2<!>: Producer<Int> = <!TYPE_MISMATCH!>p1<!>
|
||||
val p2: Producer<Int> = <!TYPE_MISMATCH!>p1<!>
|
||||
|
||||
val u1: Usual<Any> = <!TYPE_MISMATCH!>u<!>
|
||||
val <!UNUSED_VARIABLE!>u2<!>: Usual<Int> = <!TYPE_MISMATCH!>u1<!>
|
||||
val u2: Usual<Int> = <!TYPE_MISMATCH!>u1<!>
|
||||
}
|
||||
|
||||
//Arrays copy example
|
||||
class Array<T>(val length : Int, val t : T) {
|
||||
fun get(<!UNUSED_PARAMETER!>index<!> : Int) : T { return t }
|
||||
fun set(<!UNUSED_PARAMETER!>index<!> : Int, <!UNUSED_PARAMETER!>value<!> : T) { /* ... */ }
|
||||
fun get(index : Int) : T { return t }
|
||||
fun set(index : Int, value : T) { /* ... */ }
|
||||
}
|
||||
|
||||
fun copy1(<!UNUSED_PARAMETER!>from<!> : Array<Any>, <!UNUSED_PARAMETER!>to<!> : Array<Any>) {}
|
||||
fun copy1(from : Array<Any>, to : Array<Any>) {}
|
||||
|
||||
fun copy2(<!UNUSED_PARAMETER!>from<!> : Array<out Any>, <!UNUSED_PARAMETER!>to<!> : Array<in Any>) {}
|
||||
fun copy2(from : Array<out Any>, to : Array<in Any>) {}
|
||||
|
||||
fun <T> copy3(<!UNUSED_PARAMETER!>from<!> : Array<out T>, <!UNUSED_PARAMETER!>to<!> : Array<in T>) {}
|
||||
fun <T> copy3(from : Array<out T>, to : Array<in T>) {}
|
||||
|
||||
fun copy4(<!UNUSED_PARAMETER!>from<!> : Array<out Number>, <!UNUSED_PARAMETER!>to<!> : Array<in Int>) {}
|
||||
fun copy4(from : Array<out Number>, to : Array<in Int>) {}
|
||||
|
||||
fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy1(<!TYPE_MISMATCH!>ints<!>, any)
|
||||
@@ -38,4 +38,4 @@ fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy2(ints, <!TYPE_MISMATCH!>numbers<!>)
|
||||
copy3<Int>(ints, numbers)
|
||||
copy4(ints, numbers) //ok
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ class SomeClass {
|
||||
val <<!WRONG_ANNOTATION_TARGET!>@A1<!> <!WRONG_ANNOTATION_TARGET!>@A2(3)<!> <!REPEATED_ANNOTATION, WRONG_ANNOTATION_TARGET!>@A2<!> <!REPEATED_ANNOTATION, WRONG_ANNOTATION_TARGET!>@A1(<!TOO_MANY_ARGUMENTS!>12<!>)<!> <!REPEATED_ANNOTATION, WRONG_ANNOTATION_TARGET!>@A2(<!TYPE_MISMATCH!>"Test"<!>)<!> T> T.field: Int get() = 12
|
||||
|
||||
fun foo() {
|
||||
val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><<!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A1<!><!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!>(3)<!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!><!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A1<!>(12)<!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!>("Test")<!> T><!> <!UNUSED_VARIABLE!>localVal<!> = 12
|
||||
val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><<!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A1<!><!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!>(3)<!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!><!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A1<!>(12)<!> <!WRONG_ANNOTATION_TARGET!>@<!DEBUG_INFO_MISSING_UNRESOLVED!>A2<!>("Test")<!> T><!> localVal = 12
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ annotation class Ann4(val value: String)
|
||||
|
||||
fun foo() {
|
||||
<!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>Ann()<!>
|
||||
val <!UNUSED_VARIABLE!>a<!> = <!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>Ann()<!>
|
||||
val a = <!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>Ann()<!>
|
||||
|
||||
<!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>Ann1(<!NO_VALUE_FOR_PARAMETER!>)<!><!>
|
||||
<!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>Ann1(1)<!>
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
annotation class Ann(vararg val i: Boolean)
|
||||
fun foo() {
|
||||
val bool1 = true
|
||||
|
||||
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>bool1<!>) val a = bool1
|
||||
}
|
||||
compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/booleanLocalVal.kt
Vendored
+3
-2
@@ -1,6 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
annotation class Ann(vararg val i: Boolean)
|
||||
fun foo() {
|
||||
val bool1 = true
|
||||
|
||||
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>bool1<!>) val <!UNUSED_VARIABLE!>a<!> = bool1
|
||||
}
|
||||
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>bool1<!>) val a = bool1
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ annotation class Ann
|
||||
fun <@Ann R : @Ann Any> f3(a: Array<@Ann R>): Array<@Ann R?> = null!!
|
||||
|
||||
fun test2(a: @Ann Array<in @Ann Int>) {
|
||||
val r: Array<in Int?> = <!OI{OI}, TYPE_INFERENCE_CANNOT_CAPTURE_TYPES{OI}("'R' cannot capture 'in Int'. Type parameter has an upper bound 'Any' that cannot be satisfied capturing 'in' projection")!>f3<!>(<!TYPE_MISMATCH("Any; Int"), TYPE_MISMATCH("Any; Int")!>a<!>)
|
||||
val r: Array<in Int?> = <!TYPE_INFERENCE_CANNOT_CAPTURE_TYPES{OI}("'R' cannot capture 'in Int'. Type parameter has an upper bound 'Any' that cannot be satisfied capturing 'in' projection")!>f3<!>(<!TYPE_MISMATCH{NI}("Any; Int"), TYPE_MISMATCH{NI}("Any; Int")!>a<!>)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@ var test3: Int = 0
|
||||
|
||||
fun f4(fn: (@Ann Int, @Ann Int) -> Unit) {}
|
||||
|
||||
val test4 = f4 <!NI{OI}, TYPE_MISMATCH("(Int, Int) -> Unit; (Int) -> Unit")!>{ <!EXPECTED_PARAMETERS_NUMBER_MISMATCH("2; Int, Int")!>single<!> -> }<!>
|
||||
val test4 = f4 <!TYPE_MISMATCH{NI}("(Int, Int) -> Unit; (Int) -> Unit")!>{ <!EXPECTED_PARAMETERS_NUMBER_MISMATCH("2; Int, Int")!>single<!> -> }<!>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ fun foo(y: IntArray) {
|
||||
|
||||
@Ann1 y[0]
|
||||
|
||||
@Ann1 <!UNUSED_LAMBDA_EXPRESSION!>{ <!NAME_SHADOWING!>x<!>: Int -> x }<!>
|
||||
@Ann1 { <!NAME_SHADOWING!>x<!>: Int -> x }
|
||||
@Ann1 { <!NAME_SHADOWING!>x<!>: Int -> x }(1)
|
||||
@Ann1 object { fun foo() = 1 }
|
||||
@Ann1 object { fun foo() = 1 }.foo()
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ fun foo() {
|
||||
for (@Ann(1) i in 1..100) {}
|
||||
for (@Ann(2) i in 1..100) {}
|
||||
|
||||
for (<!WRONG_ANNOTATION_TARGET!>@Ann(3)<!> (<!UNUSED_VARIABLE!>x<!>, @Ann(4) <!UNUSED_VARIABLE!>y<!>) in bar()) {}
|
||||
for (<!WRONG_ANNOTATION_TARGET!>@Ann(3)<!> (x, @Ann(4) y) in bar()) {}
|
||||
|
||||
for (@<!UNRESOLVED_REFERENCE!>Err<!>() (<!UNUSED_VARIABLE!>x<!>,<!UNUSED_VARIABLE!>y<!>) in bar()) {}
|
||||
for (@<!UNRESOLVED_REFERENCE!>Err<!>() (x,y) in bar()) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ fun foo7() {
|
||||
val x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit) -> Unit = { x: <!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit -> }
|
||||
}
|
||||
|
||||
fun foo8(<!UNUSED_PARAMETER!>x<!>: Any?) {
|
||||
fun foo8(x: Any?) {
|
||||
val <!NAME_SHADOWING!>x<!>: (<!NON_PARENTHESIZED_ANNOTATIONS_ON_FUNCTIONAL_TYPES!>@Foo<!> () -> Unit)? = {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo(@<!UNRESOLVED_REFERENCE!>varargs<!> <!UNUSED_PARAMETER!>f<!> : Int) {}
|
||||
fun foo(@<!UNRESOLVED_REFERENCE!>varargs<!> f : Int) {}
|
||||
|
||||
var bar : Int = 1
|
||||
set(@<!UNRESOLVED_REFERENCE!>varargs<!> <!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(@<!UNRESOLVED_REFERENCE!>varargs<!> v) {}
|
||||
|
||||
val x : (Int) -> Int = {@<!UNRESOLVED_REFERENCE!>varargs<!> <!TYPE_MISMATCH, UNINITIALIZED_VARIABLE!>x<!> <!SYNTAX!>: Int -> x<!>}
|
||||
|
||||
class Hello(@<!UNRESOLVED_REFERENCE!>varargs<!> <!UNUSED_PARAMETER!>args<!>: Any) {
|
||||
class Hello(@<!UNRESOLVED_REFERENCE!>varargs<!> args: Any) {
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class test
|
||||
|
||||
fun foo(@test <!UNUSED_PARAMETER!>f<!> : Int) {}
|
||||
fun foo(@test f : Int) {}
|
||||
|
||||
var bar : Int = 1
|
||||
set(@test <!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(@test v) {}
|
||||
|
||||
val x : (Int) -> Int = {@test <!TYPE_MISMATCH, UNINITIALIZED_VARIABLE!>x<!> <!SYNTAX!>: Int -> x<!>} // todo fix parser annotation on lambda parameter
|
||||
|
||||
class Hello(@test <!UNUSED_PARAMETER!>args<!>: Any) {
|
||||
class Hello(@test args: Any) {
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ annotation class Foo {
|
||||
}
|
||||
|
||||
|
||||
<!ANNOTATION_CLASS_MEMBER!>constructor(<!UNUSED_PARAMETER!>s<!>: Int) {}<!>
|
||||
<!ANNOTATION_CLASS_MEMBER!>constructor(s: Int) {}<!>
|
||||
<!ANNOTATION_CLASS_MEMBER!>init {}<!>
|
||||
<!ANNOTATION_CLASS_MEMBER!>fun function() {}<!>
|
||||
<!ANNOTATION_CLASS_MEMBER!>val property get() = Unit<!>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
annotation class ann
|
||||
|
||||
fun test(@ann p: Int) {
|
||||
|
||||
}
|
||||
|
||||
val bar = fun(@ann g: Int) {}
|
||||
@@ -1,7 +1,8 @@
|
||||
// FIR_IDENTICAL
|
||||
annotation class ann
|
||||
|
||||
fun test(@ann <!UNUSED_PARAMETER!>p<!>: Int) {
|
||||
fun test(@ann p: Int) {
|
||||
|
||||
}
|
||||
|
||||
val bar = fun(@ann <!UNUSED_ANONYMOUS_PARAMETER!>g<!>: Int) {}
|
||||
val bar = fun(@ann g: Int) {}
|
||||
|
||||
@@ -5,4 +5,4 @@ annotation class Ann
|
||||
|
||||
var x: Int
|
||||
get() = 1
|
||||
set(<!WRONG_ANNOTATION_TARGET!>@Ann<!> <!WRONG_MODIFIER_TARGET!>private<!> <!UNUSED_PARAMETER!>x<!>) { }
|
||||
set(<!WRONG_ANNOTATION_TARGET!>@Ann<!> <!WRONG_MODIFIER_TARGET!>private<!> x) { }
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ class Class2 {
|
||||
<!WRONG_ANNOTATION_TARGET!>@A<!> fun foo() {}
|
||||
<!WRONG_ANNOTATION_TARGET!>@A<!> class D
|
||||
fun foo(i: <!WRONG_ANNOTATION_TARGET!>@A<!> Int) {
|
||||
<!WRONG_ANNOTATION_TARGET!>@A<!> val <!NAME_SHADOWING, UNUSED_VARIABLE!>i<!> = 1
|
||||
<!WRONG_ANNOTATION_TARGET!>@A<!> val <!NAME_SHADOWING!>i<!> = 1
|
||||
}
|
||||
fun <T> test(t: <!WRONG_ANNOTATION_TARGET!>@A<!> T): T = t
|
||||
|
||||
@@ -35,4 +35,4 @@ fun <T> test(t: <!WRONG_ANNOTATION_TARGET!>@A<!> T): T = t
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
internal annotation class C
|
||||
|
||||
fun <<!WRONG_ANNOTATION_TARGET!>@C<!> T> test2(t: T): T = t
|
||||
fun <<!WRONG_ANNOTATION_TARGET!>@C<!> T> test2(t: T): T = t
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ class C<T> {
|
||||
}
|
||||
|
||||
fun test(a: C<out CharSequence>) {
|
||||
<!MEMBER_PROJECTED_OUT{OI}("public final operator fun set(x: Int, y: T): Unit defined in C", "C<out CharSequence>"), OI{OI}!>a[1]<!> = <!CONSTANT_EXPECTED_TYPE_MISMATCH("integer; Nothing"), NI{OI}!>25<!>
|
||||
<!MEMBER_PROJECTED_OUT{OI}("public final operator fun set(x: Int, y: T): Unit defined in C; C<out CharSequence>")!>a[1]<!> = <!CONSTANT_EXPECTED_TYPE_MISMATCH{NI}("integer; Nothing")!>25<!>
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -14,5 +14,5 @@ class C<T> {
|
||||
class Out<out F>
|
||||
|
||||
fun test(a: C<out CharSequence>, y: Out<CharSequence>) {
|
||||
a + <!"C<out{OI}, "Out<CharSequence>"{OI}, "Out<Nothing>"{OI}, "public{OI}, :{OI}, C"{OI}, C<T>{OI}, CharSequence>"{OI}, NI{OI}, Out<T>{OI}, TYPE_MISMATCH("Out<Nothing>; Out<CharSequence>"), TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS{OI}, defined{OI}, final{OI}, fun{OI}, in{OI}, operator{OI}, plus{OI}, x:{OI}!>y<!>
|
||||
a + <!TYPE_MISMATCH{NI}("Out<Nothing>; Out<CharSequence>"), TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS{OI}!>y<!>
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,9 +26,9 @@ class SomeClass {
|
||||
get() = 5
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
|
||||
fun anotherFun(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!> <!UNUSED_PARAMETER!>s<!>: String) {
|
||||
fun anotherFun(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!> s: String) {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class SomeClass {
|
||||
|
||||
fun anotherFun() {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@get:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@ annotation class Second
|
||||
class SomeClass {
|
||||
|
||||
<!INAPPLICABLE_PARAM_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@param:Ann<!>
|
||||
constructor(<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!> <!UNUSED_PARAMETER!>a<!>: String)
|
||||
constructor(<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!> a: String)
|
||||
|
||||
<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
|
||||
protected val simpleProperty: String = "text"
|
||||
@@ -13,12 +13,12 @@ class SomeClass {
|
||||
<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
|
||||
fun anotherFun() {
|
||||
<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PrimaryConstructorClass(
|
||||
<!REDUNDANT_ANNOTATION_TARGET!>@param:Ann<!> <!UNUSED_PARAMETER!>a<!>: String,
|
||||
@param:[<!REDUNDANT_ANNOTATION_TARGET!>Ann<!> <!REDUNDANT_ANNOTATION_TARGET!>Second<!>] <!UNUSED_PARAMETER!>b<!>: String,
|
||||
@param:Ann val c: String)
|
||||
<!REDUNDANT_ANNOTATION_TARGET!>@param:Ann<!> a: String,
|
||||
@param:[<!REDUNDANT_ANNOTATION_TARGET!>Ann<!> <!REDUNDANT_ANNOTATION_TARGET!>Second<!>] b: String,
|
||||
@param:Ann val c: String)
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ class CustomDelegate {
|
||||
class SomeClass {
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
constructor(<!UNUSED_PARAMETER!>s<!>: String)
|
||||
constructor(s: String)
|
||||
|
||||
@property:Ann
|
||||
protected val p1: String = ""
|
||||
@@ -28,12 +28,12 @@ class SomeClass {
|
||||
@property:Ann
|
||||
var propertyWithCustomSetter: Int
|
||||
get() = 5
|
||||
set(<!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(v) {}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
fun anotherFun() {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ annotation class Ann
|
||||
class SomeClass {
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
|
||||
constructor(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!> <!UNUSED_PARAMETER!>a<!>: String)
|
||||
constructor(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!> a: String)
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
|
||||
protected val simpleProperty: String = "text"
|
||||
@@ -12,7 +12,7 @@ class SomeClass {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
|
||||
fun anotherFun() {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
val @receiver:Ann String.extensionProperty2: String
|
||||
@@ -22,4 +22,4 @@ class SomeClass {
|
||||
fun @receiver:Ann String.length2() = length
|
||||
|
||||
val @receiver:Ann String.extensionProperty: String
|
||||
get() = "A"
|
||||
get() = "A"
|
||||
|
||||
+2
-2
@@ -25,14 +25,14 @@ class SomeClass {
|
||||
@set:Ann
|
||||
var propertyWithCustomSetter: Int
|
||||
get() = 5
|
||||
set(<!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(v) {}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@set:Ann<!>
|
||||
fun annotationOnFunction(a: Int) = a + 5
|
||||
|
||||
fun anotherFun() {
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY!>@set:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -28,12 +28,12 @@ class SomeClass {
|
||||
@setparam:Ann
|
||||
var propertyWithCustomSetter: Int
|
||||
get() = 5
|
||||
set(<!UNUSED_PARAMETER!>v<!>) {}
|
||||
set(v) {}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY!>@setparam:Ann<!>
|
||||
fun anotherFun() {
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY!>@setparam:Ann<!>
|
||||
val <!UNUSED_VARIABLE!>localVariable<!> = 5
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -55,5 +55,5 @@ public class B(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@param:fieldOrPro
|
||||
var w: Int
|
||||
@getSetAndParamAnn <!REPEATED_ANNOTATION!>@get:getSetAndParamAnn<!> get() = 0
|
||||
// See KT-15470: fake INAPPLICABLE_TARGET_ON_PROPERTY
|
||||
@getSetAndParamAnn <!INAPPLICABLE_TARGET_ON_PROPERTY, REPEATED_ANNOTATION!>@set:getSetAndParamAnn<!> set(<!UNUSED_PARAMETER!>arg<!>) {}
|
||||
}
|
||||
@getSetAndParamAnn <!INAPPLICABLE_TARGET_ON_PROPERTY, REPEATED_ANNOTATION!>@set:getSetAndParamAnn<!> set(arg) {}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ var y: Int = 1
|
||||
// No backing field!
|
||||
<!MUST_BE_INITIALIZED!>var x: Int<!>
|
||||
get() = y
|
||||
set(<!ACCESSOR_PARAMETER_NAME_SHADOWING, UNUSED_PARAMETER!>field<!>) {
|
||||
set(<!ACCESSOR_PARAMETER_NAME_SHADOWING!>field<!>) {
|
||||
y = field
|
||||
}
|
||||
}
|
||||
|
||||
+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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user