Files
kotlin-fork/idea/testData/checker/BinaryCallsOnNullableValues.jet
T
Andrey Breslav 69a39907e2 Tests fixed
2011-04-04 21:26:52 +04:00

41 lines
631 B
Plaintext

class A {
fun equals(a : Any?) : Boolean
}
class B {
fun equals(a : Any?) : Boolean?
}
class C {
fun equals(a : Any?) : Int
}
fun f(): Unit {
var x: Int? = 1
x = 1
x <error>+</error> 1
x <error>plus</error> 1
x <error><</error> 1
x <error>+=</error> 1
x == 1
x != 1
<error>new A() == 1</error>
new B() <error>==</error> 1
new C() <error>==</error> 1
<error>x === "1"</error>
<error>x !== "1"</error>
x === 1
x !== 1
x<error>..</error>2
x <error>in</error> 1..2
val y : Boolean? = true
false || <error>y</error>
<error>y</error> && true
<error>y</error> && <error>1</error>
}