1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-15 04:32:21 +00:00
ton/tolk-tester/tests/unreachable-3.tolk
2025-02-11 22:52:01 +04:00

22 lines
381 B
Text

fun main(x: int?) {
if (x != null && x == null) {
return 1 + 2;
}
if (x == null) {
return -1;
}
if (x != null) {
return -2;
}
return 3 + 4;
}
/**
@testcase | 0 | 5 | -2
@testcase | 0 | null | -1
@stderr warning: type `int` is always not null
@stderr if (x != null)
@stderr warning: unreachable code
@stderr return 3 + 4
*/