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/invalid-typing-27.tolk
2025-02-11 22:52:01 +04:00

18 lines
400 B
Text

fun assignNull2<T1, T2>(mutate x: T1?, mutate y: T2?) {
if (false) {
x = null;
y = null;
}
}
fun testSmartCastsDropAfterNullableGeneric() {
var (x: int?, y: int?) = (1, 2);
x * y; // ok
assignNull2(x, y); // treated like assignments to nullable
x << y; // error
}
/**
@compilation_should_fail
@stderr can not apply operator `<<` to `int?` and `int?`
*/