hackt icon indicating copy to clipboard operation
hackt copied to clipboard

[rejects-valid] template typedef relaxed parameter binding

Open fangism opened this issue 8 years ago • 1 comments

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.

fangism avatar Jul 14 '16 00:07 fangism

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;

fangism avatar Jul 14 '16 00:07 fangism