[Issue 4413] typeof(this) doesn't work in method template signature

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 6 07:34:28 PST 2011


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


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at ubuntu.com


--- Comment #1 from Iain Buclaw <ibuclaw at ubuntu.com> 2011-02-06 07:32:03 PST ---
Calling semantic on the param type in ::deduceType seems to be simplest
workaround without causing side effects.


--- a/src/template.c
+++ b/src/template.c
@@ -2183,6 +2183,7 @@ MATCH TypeStruct::deduceType(Scope *sc, Type *tparam,
TemplateParameters *parame
      * to a template instance, too, and try again.
      */
     TemplateInstance *ti = sym->parent->isTemplateInstance();
+    tparam = tparam->semantic(0, sc);

     if (tparam && tparam->ty == Tinstance)
     {
@@ -2317,6 +2318,7 @@ MATCH TypeClass::deduceType(Scope *sc, Type *tparam,
TemplateParameters *paramet
      * to a template instance, too, and try again.
      */
     TemplateInstance *ti = sym->parent->isTemplateInstance();
+    tparam = tparam->semantic(0, sc);

     if (tparam && tparam->ty == Tinstance)
     {


Ideally though, all typeof()'s should have been expanded beforehand.

Regards

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