Revert "Update test data as operator 'mod' became deprecated"
This reverts commit 040f4e90ce.
This commit is contained in:
@@ -24,8 +24,8 @@ fun test() {
|
|||||||
if (second > 4000000)
|
if (second > 4000000)
|
||||||
break
|
break
|
||||||
|
|
||||||
if (second <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0)
|
if (second % 2 == 0)
|
||||||
sum += second
|
sum += second
|
||||||
|
|
||||||
temp = second
|
temp = second
|
||||||
second = first + second
|
second = first + second
|
||||||
|
|||||||
+6
-6
@@ -2,13 +2,13 @@
|
|||||||
// !CHECK_TYPE
|
// !CHECK_TYPE
|
||||||
class Controller {
|
class Controller {
|
||||||
suspend fun noParams(): Unit = suspendWithCurrentContinuation {
|
suspend fun noParams(): Unit = suspendWithCurrentContinuation {
|
||||||
if (hashCode() <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0) {
|
if (hashCode() % 2 == 0) {
|
||||||
it.resume(Unit)
|
it.resume(Unit)
|
||||||
Suspend
|
Suspend
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Unit
|
Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
suspend fun yieldString(value: String) = suspendWithCurrentContinuation<Int> {
|
suspend fun yieldString(value: String) = suspendWithCurrentContinuation<Int> {
|
||||||
it.resume(1)
|
it.resume(1)
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ fun test() {
|
|||||||
fooLong(1 / 1)
|
fooLong(1 / 1)
|
||||||
fooShort(1 / 1)
|
fooShort(1 / 1)
|
||||||
|
|
||||||
fooInt(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
|
fooInt(1 % 1)
|
||||||
fooByte(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
|
fooByte(1 % 1)
|
||||||
fooLong(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
|
fooLong(1 % 1)
|
||||||
fooShort(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
|
fooShort(1 % 1)
|
||||||
}
|
}
|
||||||
@@ -4,14 +4,14 @@
|
|||||||
package i
|
package i
|
||||||
|
|
||||||
public fun<T> from(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<T>) : Iterable<T> {
|
public fun<T> from(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<T>) : Iterable<T> {
|
||||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
public infix fun<T> Iterable<T>.where(<!UNUSED_PARAMETER!>predicate<!> : (T)->Boolean) : ()->Iterable<T> {
|
public infix fun<T> Iterable<T>.where(<!UNUSED_PARAMETER!>predicate<!> : (T)->Boolean) : ()->Iterable<T> {
|
||||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
fun a() {
|
fun a() {
|
||||||
val x = 0..200
|
val x = 0..200
|
||||||
val odd = from (x where {it<!DEPRECATED_BINARY_MOD_AS_REM!>%<!>2==0}) // I believe it should infer here
|
val odd = from (x where {it%2==0}) // I believe it should infer here
|
||||||
|
|
||||||
checkSubtype<Iterable<Int>>(odd)
|
checkSubtype<Iterable<Int>>(odd)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,15 @@ package i
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
public infix fun<TItem> Iterable<TItem>.where(<!UNUSED_PARAMETER!>predicate<!> : (TItem)->Boolean) : ()->Iterable<TItem> {
|
public infix fun<TItem> Iterable<TItem>.where(<!UNUSED_PARAMETER!>predicate<!> : (TItem)->Boolean) : ()->Iterable<TItem> {
|
||||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
public fun<TItem, TResult> select(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<TItem>, <!UNUSED_PARAMETER!>selector<!> : (TItem)->TResult) : ()->Iterable<TResult> {
|
public fun<TItem, TResult> select(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<TItem>, <!UNUSED_PARAMETER!>selector<!> : (TItem)->TResult) : ()->Iterable<TResult> {
|
||||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
fun a() {
|
fun a() {
|
||||||
val x = 0..200
|
val x = 0..200
|
||||||
val z = x where { i: Int -> i <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0 }
|
val z = x where { i: Int -> i % 2 == 0 }
|
||||||
val yielder = select(x where { it<!DEPRECATED_BINARY_MOD_AS_REM!>%<!>2==0 }, { it.toString() })
|
val yielder = select(x where { it%2==0 }, { it.toString() })
|
||||||
|
|
||||||
checkSubtype<() -> Iterable<Int>>(z)
|
checkSubtype<() -> Iterable<Int>>(z)
|
||||||
checkSubtype<() -> Iterable<String>>(yielder)
|
checkSubtype<() -> Iterable<String>>(yielder)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
//KT-571 Type inference failed
|
//KT-571 Type inference failed
|
||||||
fun <T, R> let(t : T, body : (T) -> R) = body(t)
|
fun <T, R> let(t : T, body : (T) -> R) = body(t)
|
||||||
private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 10}
|
private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 % 10}
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ fun main(args : Array<String>) {
|
|||||||
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>*=<!> B()
|
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>*=<!> B()
|
||||||
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>/=<!> B()
|
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>/=<!> B()
|
||||||
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>-=<!> B()
|
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>-=<!> B()
|
||||||
c <!DEPRECATED_BINARY_MOD_AS_REM, ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>%=<!> B()
|
c <!ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>%=<!> B()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user