mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-15 04:32:21 +00:00
13 lines
261 B
Text
13 lines
261 B
Text
|
fun getNullableInt(): int? { return 5; }
|
||
|
|
||
|
fun testCantApplyNotNullForAlwaysNull() {
|
||
|
var x: int? = getNullableInt();
|
||
|
if (x != null) { return 0; }
|
||
|
return x! + 1;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
@compilation_should_fail
|
||
|
@stderr operator `!` used for always null expression
|
||
|
*/
|