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-14.tolk

18 lines
448 B
Text
Raw Normal View History

2025-02-11 18:52:01 +00:00
fun eq<X>(v: X) {}
fun cantDeduceWhenNotInferred() {
// at type inferring (before type checking) they are unknown
var (x, y) = 2;
eq(x as int); // ok (since execution doesn't reach type checking)
eq<int>(x); // ok (since execution doesn't reach type checking)
eq(x);
}
/**
@compilation_should_fail
@stderr in function `cantDeduceWhenNotInferred`
@stderr can not deduce X for generic function `eq<X>`
@stderr eq(x);
*/