97ca51381a
- 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
16 lines
307 B
Kotlin
Vendored
16 lines
307 B
Kotlin
Vendored
// !LANGUAGE: -OperatorRem
|
|
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE
|
|
|
|
class Foo {
|
|
<!UNSUPPORTED_FEATURE!>operator<!> fun rem(x: Int): Foo = Foo()
|
|
}
|
|
|
|
class Bar {
|
|
<!UNSUPPORTED_FEATURE!>operator<!> fun remAssign(x: Int) {}
|
|
}
|
|
|
|
fun baz() {
|
|
val f = Foo() % 1
|
|
val b = Bar()
|
|
b %= 1
|
|
} |