[Issue 7378] inout constructors do not properly resolve to immutable.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 7 02:08:34 PDT 2013


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


Maksim Zholudev <maximzms at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |maximzms at gmail.com
         Resolution|                            |FIXED


--- Comment #1 from Maksim Zholudev <maximzms at gmail.com> 2013-06-07 02:08:30 PDT ---
Since this pull request was merged
https://github.com/D-Programming-Language/dmd/pull/1726
one must specify the qualifier explicitly:
--------------------
import std.stdio;

struct T
{
  int *data;
  this(inout(int)* d) inout {this.data = d;}
}

void main()
{
  int x;
  const int xc;
  immutable int xi;

  writeln(typeof(T(&x)).stringof);
  writeln(typeof(const T(&xc)).stringof);
  writeln(typeof(immutable T(&xi)).stringof);
}
--------------------
So now inout constructors are resolved manually.

-- 
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