[FIR] Introduce OPERATOR_CALL_ON_CONSTRUCTOR diagnostic
#KT-59943
This commit is contained in:
committed by
Space Team
parent
649bbcf35f
commit
f4d18da6a0
+4
-4
@@ -151,12 +151,12 @@ package testPackCase5
|
||||
class Case5() {
|
||||
|
||||
fun f(c: Case5){
|
||||
this + 1 //OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
c + 1 //OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
this <!OPERATOR_CALL_ON_CONSTRUCTOR!>+<!> 1 // OPERATOR_CALL_ON_CONSTRUCTOR/OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
c <!OPERATOR_CALL_ON_CONSTRUCTOR!>+<!> 1 // OPERATOR_CALL_ON_CONSTRUCTOR/OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
}
|
||||
|
||||
inner class plus constructor(val i:Int){
|
||||
operator fun invoke(i:Int) {} //(1)
|
||||
inner class plus /* (1) */ constructor(val i:Int){
|
||||
operator fun invoke(i:Int) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -151,12 +151,12 @@ package testPackCase5
|
||||
class Case5() {
|
||||
|
||||
fun f(c: Case5){
|
||||
this <!OPERATOR_MODIFIER_REQUIRED!>+<!> 1 //OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
c <!OPERATOR_MODIFIER_REQUIRED!>+<!> 1 //OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
this <!OPERATOR_MODIFIER_REQUIRED!>+<!> 1 // OPERATOR_CALL_ON_CONSTRUCTOR/OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
c <!OPERATOR_MODIFIER_REQUIRED!>+<!> 1 // OPERATOR_CALL_ON_CONSTRUCTOR/OPERATOR_MODIFIER_REQUIRED for class plus, resolved to (1)
|
||||
}
|
||||
|
||||
inner class plus constructor(val i:Int){
|
||||
operator fun invoke(i:Int) {} //(1)
|
||||
inner class plus /* (1) */ constructor(val i:Int){
|
||||
operator fun invoke(i:Int) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user