www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - UDA failling to build when using delegate

reply "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
Dear,

why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 ?

I try to have a structure which is used to fill information from
a file.
And I use UDA to tell : to get this field you need to read from x
to y using a delegate.


thanks for your advise
Nov 03 2014
parent reply "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
On Monday, 3 November 2014 at 23:53:53 UTC, bioinfornatics wrote:
 Dear,

 why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 ?

 I try to have a structure which is used to fill information from
 a file.
 And I use UDA to tell : to get this field you need to read from 
 x
 to y using a delegate.


 thanks for your advise
with ldc and dmdfe 2.066 i got: $ ldc2 test.d test.d(40): Error: type Section!((letter) => letter == '>', (letter) => letter == '\x0a') has no value tuple((Section!((letter) => letter == '>', (letter) => letter == '\x0a'))) Section!((letter) => letter == '>', (letter) => letter == '\x0a') test.d(92): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(99): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(101): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(109): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(43): Error: type Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a') has no value tuple((Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a'))) Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a') test.d(92): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(99): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(101): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(109): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(7): Error: template instance test.Parser!(Fasta, ByChunk) error instantiating
Nov 03 2014
parent reply "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
On Tuesday, 4 November 2014 at 00:32:52 UTC, bioinfornatics wrote:
 On Monday, 3 November 2014 at 23:53:53 UTC, bioinfornatics 
 wrote:
 Dear,

 why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 
 ?

 I try to have a structure which is used to fill information 
 from
 a file.
 And I use UDA to tell : to get this field you need to read 
 from x
 to y using a delegate.


 thanks for your advise
with ldc and dmdfe 2.066 i got: $ ldc2 test.d test.d(40): Error: type Section!((letter) => letter == '>', (letter) => letter == '\x0a') has no value tuple((Section!((letter) => letter == '>', (letter) => letter == '\x0a'))) Section!((letter) => letter == '>', (letter) => letter == '\x0a') test.d(92): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(99): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(101): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(109): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(43): Error: type Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a') has no value tuple((Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a'))) Section!((letter) => letter >= 'A' && letter <= 'z', (letter) => letter == '\x0a') test.d(92): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(99): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(101): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(109): Error: this for countUntil needs to be type Fasta not type Parser!(Fasta, ByChunk) test.d(7): Error: template instance test.Parser!(Fasta, ByChunk) error instantiating
No one can to help about uda?
Nov 04 2014
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 11/04/2014 01:58 PM, bioinfornatics wrote:

 test.d(40): Error: type Section!((letter) => letter == '>',
 (letter) => letter == '\x0a') has no value
You have this line: Section!(/* ... */) Although that is a type name, there is a bug somewhere and sometimes you have to use a 'value' as a UDA. (We talked about this recently but I don't remember the details.) So make it an object so that it is a 'value': Section!(/* ... */)() (You have another instance of that.) You will have to deal with the next set of error messages now. :-/ Ali
Nov 04 2014
parent reply "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:
 On 11/04/2014 01:58 PM, bioinfornatics wrote:

 test.d(40): Error: type Section!((letter) => letter == '>',
 (letter) => letter == '\x0a') has no value
You have this line: Section!(/* ... */) Although that is a type name, there is a bug somewhere and sometimes you have to use a 'value' as a UDA. (We talked about this recently but I don't remember the details.) So make it an object so that it is a 'value': Section!(/* ... */)() (You have another instance of that.) You will have to deal with the next set of error messages now. :-/ Ali
Thanks Ali If i understand well, that is a dmdfe bug ? i yes that is weird as using Section!(/* ... */)() give to me something type of void then I can't filter to the desired uda
Nov 05 2014
parent "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
On Wednesday, 5 November 2014 at 21:57:42 UTC, bioinfornatics
wrote:
 On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:
 On 11/04/2014 01:58 PM, bioinfornatics wrote:

 test.d(40): Error: type Section!((letter) => letter == '>',
 (letter) => letter == '\x0a') has no value
You have this line: Section!(/* ... */) Although that is a type name, there is a bug somewhere and sometimes you have to use a 'value' as a UDA. (We talked about this recently but I don't remember the details.) So make it an object so that it is a 'value': Section!(/* ... */)() (You have another instance of that.) You will have to deal with the next set of error messages now. :-/ Ali
Thanks Ali If i understand well, that is a dmdfe bug ? i yes that is weird as using Section!(/* ... */)() give to me something type of void then I can't filter to the desired uda
Oh that is ok, I replaced static if(is(attr : Section!T, T...)) by static if(is(Section!(T, T)))
Nov 05 2014