hackt
hackt copied to clipboard
[rejects-valid] template typedef relaxed parameter binding
file:
template <><pint N; pint B[N]>
defproc int_source(chan!(int) R) {
chp {
*[ {;i:N: R!(B[i]) } ]
}
}
template <><pint N>
typedef int_source<><1, {N}> int_source_constant;
haco compilation gives:
ERROR: failed to make process_type_reference because template argument types do not match.
ERROR making complete type reference. [9:9..28]
ERROR resolving concrete type reference in typedef! [9:9..28]
In general, the use of template typedefs requires delayed evaluation.
The following case (without relaxed parameters) works:
template <pint N; pint B[N]>
defproc int_source(chan!(int) R) {
chp {
*[ {;i:N: R!(B[i]) } ]
}
}
template <pint N>
typedef int_source<1, {N}> int_source_constant;