digitalmars.D.learn - template cannot use local as parameter to non-global template
- simendsjo (5/5) Mar 17 2013 I get a lot of these errors, and they can be quite tricky to get
- John Colvin (3/9) Mar 17 2013 A small code example that generates that error would be very
- Timon Gehr (2/7) Mar 17 2013 http://d.puremagic.com/issues/show_bug.cgi?id=5710
- simendsjo (8/19) Mar 17 2013 Looks like the same issue. For me the use-case was a bit
- Timon Gehr (2/17) Mar 17 2013 It is not a wont-fix, and it actually should work.
- simendsjo (3/28) Mar 17 2013 All the talk there looks to be around delegates. Would the same
- Timon Gehr (10/36) Mar 17 2013 Of course. It is exactly the same issue. In D, if any kind of local
I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)
Mar 17 2013
On Sunday, 17 March 2013 at 12:54:24 UTC, simendsjo wrote:I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)A small code example that generates that error would be very useful in helping you.
Mar 17 2013
On 03/17/2013 01:54 PM, simendsjo wrote:I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)http://d.puremagic.com/issues/show_bug.cgi?id=5710
Mar 17 2013
On Sunday, 17 March 2013 at 15:45:54 UTC, Timon Gehr wrote:On 03/17/2013 01:54 PM, simendsjo wrote:Looks like the same issue. For me the use-case was a bit different though.. I want to access struct members at CT only to look for UDAs, it's type etc. It works with workarounds, but the code gets ugly, and much convenience is lost.. Too bad it looks like a wont-fix.I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)http://d.puremagic.com/issues/show_bug.cgi?id=5710
Mar 17 2013
On 03/17/2013 05:15 PM, simendsjo wrote:On Sunday, 17 March 2013 at 15:45:54 UTC, Timon Gehr wrote:It is not a wont-fix, and it actually should work.On 03/17/2013 01:54 PM, simendsjo wrote:Looks like the same issue. For me the use-case was a bit different though.. I want to access struct members at CT only to look for UDAs, it's type etc. It works with workarounds, but the code gets ugly, and much convenience is lost.. Too bad it looks like a wont-fix.I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)http://d.puremagic.com/issues/show_bug.cgi?id=5710
Mar 17 2013
On Sunday, 17 March 2013 at 16:21:25 UTC, Timon Gehr wrote:On 03/17/2013 05:15 PM, simendsjo wrote:All the talk there looks to be around delegates. Would the same fix work for my struct members?On Sunday, 17 March 2013 at 15:45:54 UTC, Timon Gehr wrote:It is not a wont-fix, and it actually should work.On 03/17/2013 01:54 PM, simendsjo wrote:Looks like the same issue. For me the use-case was a bit different though.. I want to access struct members at CT only to look for UDAs, it's type etc. It works with workarounds, but the code gets ugly, and much convenience is lost.. Too bad it looks like a wont-fix.I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)http://d.puremagic.com/issues/show_bug.cgi?id=5710
Mar 17 2013
On 03/17/2013 05:36 PM, simendsjo wrote:On Sunday, 17 March 2013 at 16:21:25 UTC, Timon Gehr wrote:Of course. It is exactly the same issue. In D, if any kind of local symbol is passed to a templated function, the templated function requires a context pointer to access the local symbol. Non-static member functions require a 'this' reference. Only one additional implicit pointer can be passed to a non-static member function at a time, since every member function must be able to provide delegates. Therefore, there must be an additional indirection somewhere. (Eg. pass the 'this' pointer as a local variable inside the delegate context.)On 03/17/2013 05:15 PM, simendsjo wrote:All the talk there looks to be around delegates. Would the same fix work for my struct members?On Sunday, 17 March 2013 at 15:45:54 UTC, Timon Gehr wrote:It is not a wont-fix, and it actually should work.On 03/17/2013 01:54 PM, simendsjo wrote:Looks like the same issue. For me the use-case was a bit different though.. I want to access struct members at CT only to look for UDAs, it's type etc. It works with workarounds, but the code gets ugly, and much convenience is lost.. Too bad it looks like a wont-fix.I get a lot of these errors, and they can be quite tricky to get around and hurts my API.. Is this a temporary restriction in DMD, or is it another reason why this doesn't work? Error: template instance template!local cannot use local 'local' as parameter to non-global template innerTemplate(alias T)http://d.puremagic.com/issues/show_bug.cgi?id=5710
Mar 17 2013