[Issue 17055] New: this(...) hides this() of mixed in template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 2 03:58:51 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17055

          Issue ID: 17055
           Summary: this(...) hides this() of mixed in template
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ralph.bariz at gmail.com

Expected:
Can overload ctors defined inside a mixed in template

Observed:
When I mixin a template containing this() and define additionally a this(...) I
get Error: none of the overloads of '__ctor' are callable using argument types
()

Notes(ketmar explains why):
<RalphBa> can anyone explain me, when I mixin a template containing this() and
define additionally a this(...) why I get Error: none of the overloads of
'__ctor' are callable using argument types ()
 as soon as I remove the additional this(...) it works :D
 seems like the additional this(...) would hide the this() from the template
 well, we are speaking about a class construct
 would guess I have to alias it, but thats not working with this keyword :D
--> BearishMushroom (~BearishMu at 90-231-174-194-no159.tbcn.telia.com) hat #d
betreten
* DFeed [GDC] Ma‎rco Le‎ise posted "gdc executable name for install target":
http://j.mp/2iZg0EA
--> aldacron (~aldacron at 49.1.163.99) hat #d betreten
<ketmar> RalphBa: fill a bug
<RalphBa> wait, maybe its my fault
<ketmar> no
<RalphBa> oh :D
<ketmar> technically, even mixin template creates a scope
 that scope is invisible, and should not affect overloads. but it does.
<RalphBa> any idea for a temp workaround?
<ketmar> only string mixin. alas.
 you are completely right about bringing overloads in with `alias`, and you are
right again about impossibility to do that with ctors ;-)

--


More information about the Digitalmars-d-bugs mailing list