Fix language feature for mod/rem tests for migration to 1.3 version
After 2e88f5c47d
This commit is contained in:
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object ModAndRem {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER, -EXTENSION_SHADOWED_BY_MEMBER
|
||||
|
||||
class ModAndRemAssign {
|
||||
|
||||
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
// !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
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !API_VERSION: 1.0
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE, -EXTENSION_SHADOWED_BY_MEMBER
|
||||
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
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
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Foo {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class A {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object B
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class A {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Foo {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER, -EXTENSION_SHADOWED_BY_MEMBER
|
||||
|
||||
class ModAndRemAssign {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object RemAndModAssign {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitOperatorMod
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object A {
|
||||
|
||||
+8
-3
@@ -13833,9 +13833,14 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt");
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0_after.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0_after.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0_before.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0_before.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("numberRemConversions.kt")
|
||||
|
||||
Generated
+8
-3
@@ -13833,9 +13833,14 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noOperatorRemFeature.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt");
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0_after.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0_after() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0_after.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noWarningForModFromBuiltinsWhenApi1_0_before.kt")
|
||||
public void testNoWarningForModFromBuiltinsWhenApi1_0_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0_before.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("numberRemConversions.kt")
|
||||
|
||||
Reference in New Issue
Block a user