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:
+12
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Foo {
|
||||
}
|
||||
operator fun Foo.mod(x: Int): Foo = Foo()
|
||||
operator fun Foo.rem(x: Int): Int = 0
|
||||
|
||||
fun foo() {
|
||||
takeInt(Foo() % 1)
|
||||
}
|
||||
|
||||
fun takeInt(x: Int) {}
|
||||
Reference in New Issue
Block a user