| Thread overview | |||||
|---|---|---|---|---|---|
  | 
January 12, 2006 [ ] isn't parsed correctly from a template char[] argument | ||||
|---|---|---|---|---|
  | ||||
Possibly the same cause as the previous bug, because
it also goes away if you introduce parentheses.
Error:
 fish is used as a type
---------------
template whale(char walrus)
{
   const char whale = walrus;
}
template dolphin(char [] fish)
{
//const char dolphin = whale!((fish[4])); // OK
  const char dolphin = whale!(fish[4]); // fails
}
const char urchin = dolphin!("anenome");
 | ||||
January 12, 2006 Re: [ ] isn't parsed correctly from a template char[] argument | ||||
|---|---|---|---|---|
  | ||||
Posted in reply to Don Clugston  | Don Clugston wrote:
> Possibly the same cause as the previous bug, because
> it also goes away if you introduce parentheses.
> 
> Error:
>  fish is used as a type
> 
> ---------------
> template whale(char walrus)
> {
>    const char whale = walrus;
> }
> 
> template dolphin(char [] fish)
> {
> //const char dolphin = whale!((fish[4])); // OK
>   const char dolphin = whale!(fish[4]); // fails
> }
> 
> const char urchin = dolphin!("anenome");
I've run into this one too, although I didn't think to use an extra set of parens. Would be nice to see this fixed.
 | |||
January 15, 2006 Re: [ ] isn't parsed correctly from a template char[] argument | ||||
|---|---|---|---|---|
  | ||||
Posted in reply to Don Clugston Attachments:  | Don Clugston schrieb am 2006-01-12: > Possibly the same cause as the previous bug, because > it also goes away if you introduce parentheses. > > Error: > fish is used as a type > > --------------- > template whale(char walrus) > { > const char whale = walrus; > } > > template dolphin(char [] fish) > { > //const char dolphin = whale!((fish[4])); // OK > const char dolphin = whale!(fish[4]); // fails > } > > const char urchin = dolphin!("anenome"); Added to DStress as http://dstress.kuehne.cn/run/t/template_23_A.d http://dstress.kuehne.cn/run/t/template_23_B.d Thomas  | |||
Copyright © 1999-2021 by the D Language Foundation
 
Permalink
Reply