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
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// !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
|
||||
}
|
||||
Reference in New Issue
Block a user