Update test data as operator 'mod' became deprecated

Revert this commit after changing 'mod' to 'rem' in stdlib
This commit is contained in:
Mikhail Zarechenskiy
2016-12-06 13:31:18 +03:00
parent 5f71f1bcad
commit 040f4e90ce
7 changed files with 21 additions and 21 deletions
@@ -24,8 +24,8 @@ fun test() {
if (second > 4000000)
break
if (second % 2 == 0)
sum += second
if (second <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0)
sum += second
temp = second
second = first + second
@@ -2,13 +2,13 @@
// !CHECK_TYPE
class Controller {
suspend fun noParams(): Unit = suspendWithCurrentContinuation {
if (hashCode() % 2 == 0) {
it.resume(Unit)
Suspend
}
if (hashCode() <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0) {
it.resume(Unit)
Suspend
}
else {
Unit
}
Unit
}
}
suspend fun yieldString(value: String) = suspendWithCurrentContinuation<Int> {
it.resume(1)
@@ -19,8 +19,8 @@ fun test() {
fooLong(1 / 1)
fooShort(1 / 1)
fooInt(1 % 1)
fooByte(1 % 1)
fooLong(1 % 1)
fooShort(1 % 1)
fooInt(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
fooByte(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
fooLong(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
fooShort(1 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 1)
}
@@ -4,14 +4,14 @@
package i
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> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun a() {
val x = 0..200
val odd = from (x where {it%2==0}) // I believe it should infer here
val odd = from (x where {it<!DEPRECATED_BINARY_MOD_AS_REM!>%<!>2==0}) // I believe it should infer here
checkSubtype<Iterable<Int>>(odd)
}
@@ -6,15 +6,15 @@ package i
import java.util.ArrayList
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> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun a() {
val x = 0..200
val z = x where { i: Int -> i % 2 == 0 }
val yielder = select(x where { it%2==0 }, { it.toString() })
val z = x where { i: Int -> i <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0 }
val yielder = select(x where { it<!DEPRECATED_BINARY_MOD_AS_REM!>%<!>2==0 }, { it.toString() })
checkSubtype<() -> Iterable<Int>>(z)
checkSubtype<() -> Iterable<String>>(yielder)
+1 -1
View File
@@ -1,3 +1,3 @@
//KT-571 Type inference failed
fun <T, R> let(t : T, body : (T) -> R) = body(t)
private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 % 10}
private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 10}
+1 -1
View File
@@ -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 <!DEPRECATED_BINARY_MOD_AS_REM, ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT!>%=<!> B()
}