Ticket #72 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

'Exotic' template signatures are not recognized

Reported by: aarti_pl Assigned to:
Priority: major Component: descent.astview
Version: 0.5 Keywords:
Cc:

Description

Below valid template declaration is considered as invalid:

template staticArrayType(T : U[N], U, size_t N) {
  alias U staticArrayType;
}

Change History

04/30/08 07:09:52 changed by asterite

Ok, I found it. Compiling it with DMD 1.020 it gives me:

main.d(1): variable N forward referenced main.d(1): Error: Integer constant expression expected instead of N main.d(1): Error: Integer constant expression expected instead of cast(uint)N main.d(1): Error: Integer constant expression expected instead of cast(uint)N

Same as in Descent. However, compiling with DMD 1.028 it compiles ok. So we have to update to DMD 1.028 to get rid of that error. But I doubt that will happen for the net release. Probably for the next one. :-)

Temporarily, you can turn semantic errors off.

05/07/08 07:06:41 changed by asterite

Look what I've found in mtype.c while porting to DMD 1.028:

--- if (sc->parameterSpecialization && dim->op == TOKvar &&

((VarExp? *)dim)->var->storage_class & STCtemplateparameter)

{

/* It could be a template parameter N which has no value yet:

  • template Foo(T : T[N], size_t N); */

return this;

} ---

:-)

05/08/08 17:51:03 changed by asterite

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in trunk.