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-generics-13.tolk

12 lines
247 B
Text
Raw Normal View History

2025-02-11 18:49:26 +00:00
fun calcSum<X>(x: X, y: X) { return x + y; }
fun cantApplyPlusOnNullable() {
return calcSum(((0 as int?)), null);
}
/**
@compilation_should_fail
2025-02-11 18:52:01 +00:00
@stderr in function `calcSum<int?>`
2025-02-11 18:49:26 +00:00
@stderr can not apply operator `+` to `int?` and `int?`
*/