[Assign plugin] Add a compiler plugin for overloading assign ('=') operator
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
6052962f50
commit
09d6dfc8bf
@@ -0,0 +1,17 @@
|
||||
/plusAssignPrecedence.kt:96:19: error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
|
||||
public operator fun String?.plus(other: Any?): String defined in kotlin
|
||||
task.valInput += "K"
|
||||
^
|
||||
/plusAssignPrecedence.kt:97:19: error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
|
||||
public operator fun String?.plus(other: Any?): String defined in kotlin
|
||||
task.varInput += "K"
|
||||
^
|
||||
/plusAssignPrecedence.kt:99:5: error: val cannot be reassigned
|
||||
task.valInputWithPlus += "K"
|
||||
^
|
||||
/plusAssignPrecedence.kt:101:40: error: assignment operators ambiguity:
|
||||
public final operator fun plus(v: String): StringPropertyWithPlusAndPlusAssign defined in StringPropertyWithPlusAndPlusAssign
|
||||
public final operator fun plusAssign(v: String): Unit defined in StringPropertyWithPlusAndPlusAssign
|
||||
task.varInputWithPlusAndPlusAssign += "K"
|
||||
^
|
||||
|
||||
Reference in New Issue
Block a user