www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11458] New: initialization of a custom type(using alias this) broken in dmd 2.064.2

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11458

           Summary: initialization of a custom type(using alias this)
                    broken in dmd 2.064.2
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: burg.basile yahoo.com


--- Comment #0 from burg.basile yahoo.com 2013-11-06 19:18:09 PST ---
regression from dmd 2.063.2 to 2.064.2, initialization of a custom type using
alias this.

example:
--------

  struct myType{int _field; alias _field this;}

  struct myStruct
  {
      private:
          myType dt;

      public:
          this (string param)
          {
              dt = 0;
          }
  }

  void main(string[] args)
  {
    auto MyStruct = myStruct("broken");
  }

outputs:
--------

file.d(11): Error: cannot implicitly convert expression (0) of type int to
myType

other:
------
verified on Win x86, Linux X86_64.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 06 2013
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11458


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-11-06 19:42:33 PST ---
This is an intended language fix introduced by fixing bug 9665.
See also issue 11270 comments.

*** This issue has been marked as a duplicate of issue 11270 ***

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