[Issue 12074] Add BlockStatement to TemplateSingleArgument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 4 03:40:27 PST 2014


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



--- Comment #2 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-02-04 13:40:23 EET ---
Kenji's patch is now outdated (not surprising). However, this very simple patch
seems to work just fine:

diff --git a/src/parse.c b/src/parse.c
index 78a2356..088326d 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -2360,6 +2360,8 @@ Objects *Parser::parseTemplateArgument()
         case TOKfuncstring:
         case TOKprettyfunc:
         case TOKthis:
+        case TOKlcurly:
+        case TOKlbracket:
         {   // Template argument is an expression
             Expression *ea = parsePrimaryExp();
             tiargs->push(ea);

The original patch explicitly set the expression type to that of a function.
This doesn't seem to be necessary, as the compiler now infers whether it is a
function or delegate literal depending on whether statements refer to the
literal's context.

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