[Issue 8847] voldemort + inout confuses "is"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 18 02:19:30 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8847



--- Comment #1 from monarchdodra at gmail.com 2012-10-18 02:19:29 PDT ---
(In reply to comment #0)
> Which is very strange. I found the root condition that recreates this: It is
> having a voldemort function that is qualified with inout:
> 
> //----
> import std.stdio;
> import std.conv;
> 
> auto S()
> {
>     static struct Result
>     {
>       inout(Result) get() inout {return this;}
>     }
>     return Result();
> }
> 
> void main()
> {
>     auto a = S();
>     auto b = a.get();
>     alias typeof(a) A;
>     alias typeof(b) B;
>     writeln("Typeof A: ", A.stringof);
>     writeln("Typeof B: ", B.stringof);
>     assert(is(A == B), text(A.stringof, " is different from " , B.stringof));
> }
> //----
> Typeof A: Result
> Typeof B: Result
> core.exception.AssertError at main.d(21): Result is different from Result
> //----

Yeah, I forgot to mention, if you remove the "inout" attribute, or if you make
Result a global struct, the problem disappears, so it *really* only ever
appears when inout and voldemort are combined.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list