[Issue 9551] template this parameter not recognized in constructors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 20 08:31:11 PST 2013


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



--- Comment #4 from Gor Gyolchanyan <gor.f.gyolchanyan at gmail.com> 2013-02-20 08:31:09 PST ---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > (In reply to comment #0)
> > > > Because of the following compile-time errors:
> > > > 
> > > >     C:\Users\g.gyolchanyan\Desktop\test.d(3): Error: found 'This_' when
> > > > expecting ')'
> > > >     C:\Users\g.gyolchanyan\Desktop\test.d(3): Error: semicolon expected
> > > > following function declaration
> > > >     C:\Users\g.gyolchanyan\Desktop\test.d(3): Error: Declaration expected, not
> > > > ')'
> > > 
> > > As far as I see, it conflicts with postblit syntax `this(this)`.
> > 
> > Yes, it definitely looks like it, but the existence of a type name after "this"
> > in the template parameter list should disambiguate it.
> 
> But, it is not just only a parser problem.
> Constructor will be treated specially for object construction entry. And,
> unfortunately, language semantics between non-mutable object construction and
> qualified constructor is yet not defined well. The combination of
> TemplateThisParameter and constructor may touch similar *yet not defined
> semantics*.
> 
> Therefore, I must say that this issue will not be fix soon.

This is extremely unfortunate, because this is the only way that I know of to
implement transparent dynamic dispatch.

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