Prohibit operator mod as declaration and calls that resolved via it

#KT-24197 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-06-28 03:04:13 +03:00
parent c887b88ed9
commit 2e88f5c47d
16 changed files with 149 additions and 8 deletions
@@ -0,0 +1,6 @@
// "Remove 'operator' modifier" "true"
// COMPILER_ARGUMENTS: -XXLanguage:+ProhibitOperatorMod
object A {
operator<caret> fun mod(x: Int) {}
}
@@ -0,0 +1,6 @@
// "Remove 'operator' modifier" "true"
// COMPILER_ARGUMENTS: -XXLanguage:+ProhibitOperatorMod
object A {
fun mod(x: Int) {}
}
@@ -0,0 +1,14 @@
// "Rename to 'rem'" "true"
// DISABLE-ERRORS
// COMPILER_ARGUMENTS: -XXLanguage:+ProhibitOperatorMod
object Rem {
operator<caret> fun mod(x: Int) {}
operator fun modAssign(x: Int) {}
}
fun test() {
Rem % 1
Rem.mod(1)
Rem.modAssign(1)
}
@@ -0,0 +1,14 @@
// "Rename to 'rem'" "true"
// DISABLE-ERRORS
// COMPILER_ARGUMENTS: -XXLanguage:+ProhibitOperatorMod
object Rem {
operator fun rem(x: Int) {}
operator fun modAssign(x: Int) {}
}
fun test() {
Rem % 1
Rem.rem(1)
Rem.modAssign(1)
}