Remove mod function deprecation tests

#KT-26654
This commit is contained in:
Ilya Gorbunov
2020-01-22 06:01:43 +03:00
parent b1766b167f
commit 39078342ee
21 changed files with 0 additions and 411 deletions
@@ -1,3 +0,0 @@
fun test() {
1.mod(3)
}
@@ -1,3 +0,0 @@
fun test() {
1.<!DEPRECATION_ERROR!>mod<!>(3)
}
@@ -1,3 +0,0 @@
package
public fun test(): kotlin.Unit
@@ -1,48 +0,0 @@
// !LANGUAGE: +ProhibitOperatorMod
// !WITH_NEW_INFERENCE
// !API_VERSION: 1.0
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE, -EXTENSION_SHADOWED_BY_MEMBER
class Foo {
operator fun rem(x: Int): Foo = Foo()
}
class Bar {
operator fun remAssign(x: Int) {}
}
class Baz {
companion object {
operator fun rem(x: Int) {}
operator fun Int.rem(x: Int) {}
}
}
operator fun Baz.rem(x: Int) {}
fun local() {
operator fun Int.rem(x: Int) {}
operator fun String.remAssign(x: Int) {}
}
class WithMod {
operator fun mod(other: WithMod) = this
fun test() {
val a = this <!INAPPLICABLE_CANDIDATE!>%<!> this
var b = this.mod(this)
<!UNRESOLVED_REFERENCE!>b %= this<!>
}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a %= 3
1.mod(2)
b % s
1.0 % 2.0
}
@@ -1,48 +0,0 @@
// !LANGUAGE: +ProhibitOperatorMod
// !WITH_NEW_INFERENCE
// !API_VERSION: 1.0
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE, -EXTENSION_SHADOWED_BY_MEMBER
class Foo {
operator fun rem(x: Int): Foo = Foo()
}
class Bar {
operator fun remAssign(x: Int) {}
}
class Baz {
companion object {
operator fun rem(x: Int) {}
operator fun Int.rem(x: Int) {}
}
}
operator fun Baz.rem(x: Int) {}
fun local() {
operator fun Int.rem(x: Int) {}
operator fun String.remAssign(x: Int) {}
}
class WithMod {
<!FORBIDDEN_BINARY_MOD!>operator<!> fun mod(other: WithMod) = this
fun test() {
val a = this <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%<!> <!NI;TYPE_MISMATCH!>this<!>
var b = this.mod(this)
<!NI;TYPE_MISMATCH!>b <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%=<!> <!NI;TYPE_MISMATCH!>this<!><!>
}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE!>%=<!> 3
1.mod(2)
b % <!NI;TYPE_MISMATCH!>s<!>
1.0 % <!NI;CONSTANT_EXPECTED_TYPE_MISMATCH!>2.0<!>
}
@@ -1,47 +0,0 @@
package
public fun builtIns(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short): kotlin.Unit
public fun local(): kotlin.Unit
public fun noOverflow(): kotlin.Unit
public operator fun Baz.rem(/*0*/ x: kotlin.Int): kotlin.Unit
public final class Bar {
public constructor Bar()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun remAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Baz {
public constructor Baz()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public companion object Companion {
private constructor Companion()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun rem(/*0*/ x: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final operator fun kotlin.Int.rem(/*0*/ x: kotlin.Int): kotlin.Unit
}
}
public final class Foo {
public constructor Foo()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun rem(/*0*/ x: kotlin.Int): Foo
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class WithMod {
public constructor WithMod()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun mod(/*0*/ other: WithMod): WithMod
public final fun test(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,48 +0,0 @@
// !LANGUAGE: -ProhibitOperatorMod
// !WITH_NEW_INFERENCE
// !API_VERSION: 1.0
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE, -EXTENSION_SHADOWED_BY_MEMBER
class Foo {
operator fun rem(x: Int): Foo = Foo()
}
class Bar {
operator fun remAssign(x: Int) {}
}
class Baz {
companion object {
operator fun rem(x: Int) {}
operator fun Int.rem(x: Int) {}
}
}
operator fun Baz.rem(x: Int) {}
fun local() {
operator fun Int.rem(x: Int) {}
operator fun String.remAssign(x: Int) {}
}
class WithMod {
operator fun mod(other: WithMod) = this
fun test() {
val a = this <!INAPPLICABLE_CANDIDATE!>%<!> this
var b = this.mod(this)
<!UNRESOLVED_REFERENCE!>b %= this<!>
}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a %= 3
1.mod(2)
b % s
1.0 % 2.0
}
@@ -1,48 +0,0 @@
// !LANGUAGE: -ProhibitOperatorMod
// !WITH_NEW_INFERENCE
// !API_VERSION: 1.0
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE, -EXTENSION_SHADOWED_BY_MEMBER
class Foo {
operator fun rem(x: Int): Foo = Foo()
}
class Bar {
operator fun remAssign(x: Int) {}
}
class Baz {
companion object {
operator fun rem(x: Int) {}
operator fun Int.rem(x: Int) {}
}
}
operator fun Baz.rem(x: Int) {}
fun local() {
operator fun Int.rem(x: Int) {}
operator fun String.remAssign(x: Int) {}
}
class WithMod {
<!DEPRECATED_BINARY_MOD!>operator<!> fun mod(other: WithMod) = this
fun test() {
val a = this <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%<!> <!NI;TYPE_MISMATCH!>this<!>
var b = this.mod(this)
<!NI;TYPE_MISMATCH!>b <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%=<!> <!NI;TYPE_MISMATCH!>this<!><!>
}
}
fun noOverflow() {
(-1).mod(5)
}
fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE!>%=<!> 3
1.mod(2)
b % <!NI;TYPE_MISMATCH!>s<!>
1.0 % <!NI;CONSTANT_EXPECTED_TYPE_MISMATCH!>2.0<!>
}
@@ -1,47 +0,0 @@
package
public fun builtIns(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short): kotlin.Unit
public fun local(): kotlin.Unit
public fun noOverflow(): kotlin.Unit
public operator fun Baz.rem(/*0*/ x: kotlin.Int): kotlin.Unit
public final class Bar {
public constructor Bar()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun remAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Baz {
public constructor Baz()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public companion object Companion {
private constructor Companion()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun rem(/*0*/ x: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final operator fun kotlin.Int.rem(/*0*/ x: kotlin.Int): kotlin.Unit
}
}
public final class Foo {
public constructor Foo()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun rem(/*0*/ x: kotlin.Int): Foo
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class WithMod {
public constructor WithMod()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun mod(/*0*/ other: WithMod): WithMod
public final fun test(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,5 +0,0 @@
// !API_VERSION: 1.1
fun test() {
1.mod(3)
}
@@ -1,5 +0,0 @@
// !API_VERSION: 1.1
fun test() {
1.<!DEPRECATION!>mod<!>(3)
}
@@ -1,3 +0,0 @@
package
public fun test(): kotlin.Unit
@@ -1,5 +0,0 @@
// !API_VERSION: 1.2
fun test() {
1.mod(3)
}
@@ -1,5 +0,0 @@
// !API_VERSION: 1.2
fun test() {
1.<!DEPRECATION!>mod<!>(3)
}
@@ -1,3 +0,0 @@
package
public fun test(): kotlin.Unit