Files
kotlin/compiler/testData/diagnostics/tests/operatorRem/operatorRem.kt
Mikhail Zarechenskiy 97ca51381a Gradual migration of operator 'mod' to 'rem'
- Introduce new 'rem' operator convention
 - Prefer 'rem()' to 'mod()' when both are available, even if mod() is a
   member, and rem() -- an extension
 - Place operator 'rem' under the language feature
2016-12-09 16:43:35 +03:00

15 lines
228 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE
class Foo {
operator fun rem(x: Int): Foo = Foo()
}
class Bar {
operator fun remAssign(x: Int) {}
}
fun baz() {
val f = Foo() % 1
val b = Bar()
b %= 1
}