[Issue 1566] Nested template issue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 5 08:10:50 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=1566


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |diagnostic


--- Comment #5 from Stewart Gordon <smjg at iname.com> 2014-01-05 08:10:46 PST ---
Oh yes.  The grammar is
http://dlang.org/template.html

TemplateInstance:
    TemplateIdentifier TemplateArguments

TemplateArguments:
    !( )
    !( TemplateArgumentList )
    ! TemplateSingleArgument

TemplateIdentifier:
    Identifier

And so
    T!(3)!('b')
isn't parseable as a TemplateInstance.

As such, the compiler is behaving according to spec.

However, there's a problem: (T!(3)) is equally not an Identifier, so going by
this spec we can't even write (T!(3))!('b').  This seems overly restrictive.

But the error message is confusing, and liable to make the user think the
compiler is playing up.  We should explicitly detect an attempt to do this, and
deliver a clearer error message.  As such, I'm changing this to diagnostic.

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


More information about the Digitalmars-d-bugs mailing list