digitalmars.D.learn - value of 'this' is not know at CT for typeof(this)
- Dechcaudron (12/12) Jan 26 2018 So I'm trying to get this to compile:
- Simen =?UTF-8?B?S2rDpnLDpXM=?= (5/17) Jan 26 2018 I can't reproduce the problem. Could you give us some more code -
- Dechcaudron (4/8) Jan 27 2018 https://github.com/Dechcaudron/dserialize/tree/6c67e44dedf81d9cb8c0d9d80...
So I'm trying to get this to compile: ``` static foreach (alias member; getSymbolsByUDA!(typeof(this), Serialize)) serializeMember!member(bundle); ``` And I'm getting the following error: value of 'this' is not known at compile time for the line on top. typeof(this) to get the type of the calling object seems to work everywhere else (this happens inside a method definition inside a mixin template). Can anyone tell me why?
Jan 26 2018
On Friday, 26 January 2018 at 20:08:19 UTC, Dechcaudron wrote:So I'm trying to get this to compile: ``` static foreach (alias member; getSymbolsByUDA!(typeof(this), Serialize)) serializeMember!member(bundle); ``` And I'm getting the following error: value of 'this' is not known at compile time for the line on top. typeof(this) to get the type of the calling object seems to work everywhere else (this happens inside a method definition inside a mixin template). Can anyone tell me why?I can't reproduce the problem. Could you give us some more code - preferably a compilable segment that gives the same problem? -- Simen
Jan 26 2018
On Friday, 26 January 2018 at 20:13:14 UTC, Simen Kjærås wrote:I can't reproduce the problem. Could you give us some more code - preferably a compilable segment that gives the same problem? -- Simenhttps://github.com/Dechcaudron/dserialize/tree/6c67e44dedf81d9cb8c0d9d80cf4eb85e9abecd0 There it goes, dub test to see it. Tests are not expected to pass, but they should compile.
Jan 27 2018