1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-13 03:32:22 +00:00
ton/tolk-tester/tests/invalid-generics-7.tolk

19 lines
386 B
Text
Raw Normal View History

fun failOnInstantiation(a: slice) {
var b: slice = foo(a);
}
fun bar<X>(value: X) : X {
return 1;
}
fun foo<X>(value: X) : X {
return bar(value);
}
/**
@compilation_should_fail
@stderr while instantiating generic function `foo<slice>`
@stderr while instantiating generic function `bar<slice>`
@stderr can not convert type `int` to return type `slice`
@stderr return 1
*/