[Issue 1211] mixin("__LINE__") gives incorrect value

BCS BCS at pathlink.com
Sat May 5 15:24:37 PDT 2007


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1211
> 
> 
> smjg at iname.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |smjg at iname.com
>            Keywords|                            |wrong-code
>             Summary|mixin("__LINE__")           |mixin("__LINE__") gives
>                    |                            |incorrect value
> 
> 
> 
> 
> ------- Comment #2 from smjg at iname.com  2007-05-05 08:27 -------
> 
>>writef("%\n", mixin(string)); // 1, 3 or 4? what about generated strings?
> 
> 
> What is %\n? 

a typeo

 > And how is 3 a plausible value in your example?

1 is the line of the mixin
3 is the line in the string
4 is the file line where __LINE__ is
> 
> 
>>how about a dotted form?
>>
>><mixin_line>.<line_in_mixin>
> 
> 
> Then how would we distinguish between 2.1 and 2.10?
> 

__LINE__.typeof == int, != char[]  // Oops!!



More information about the Digitalmars-d-bugs mailing list