| Thread overview |
|---|
July 04, 2013 interface default implementation mixin | ||||
|---|---|---|---|---|
| ||||
I'm trying to create a default interface mixin tempate. Some prototype code I've come up with generates the members property but I get an error I don't understand: http://dpaste.dzfl.pl/58c0392d void myfunc(float a, int b, string c) { a.myfunc(a, b, c); } /d650/f247.d(70): Error: no property 'myfunc' for type 'float' The mixin doesn't seem to work properly though even though it is generating a valid implementation of the interface... unless I'm missing something. | ||||
July 04, 2013 Re: interface default implementation mixin | ||||
|---|---|---|---|---|
| ||||
Posted in reply to JS | On Thursday, 4 July 2013 at 11:13:54 UTC, JS wrote:
> I'm trying to create a default interface mixin tempate. Some prototype code I've come up with generates the members property but I get an error I don't understand:
>
> http://dpaste.dzfl.pl/58c0392d
>
> void myfunc(float a, int b, string c) { a.myfunc(a, b, c); }
>
> /d650/f247.d(70): Error: no property 'myfunc' for type 'float'
>
>
> The mixin doesn't seem to work properly though even though it is generating a valid implementation of the interface... unless I'm missing something.
local variable names ('a' in function args list) shadow those in outer scopes ('a' as a class member)
| |||
July 04, 2013 Re: interface default implementation mixin | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Thursday, 4 July 2013 at 11:32:25 UTC, Dicebot wrote: > On Thursday, 4 July 2013 at 11:13:54 UTC, JS wrote: >> I'm trying to create a default interface mixin tempate. Some prototype code I've come up with generates the members property but I get an error I don't understand: >> >> http://dpaste.dzfl.pl/58c0392d >> >> void myfunc(float a, int b, string c) { a.myfunc(a, b, c); } >> >> /d650/f247.d(70): Error: no property 'myfunc' for type 'float' >> >> >> The mixin doesn't seem to work properly though even though it is generating a valid implementation of the interface... unless I'm missing something. > > local variable names ('a' in function args list) shadow those in outer scopes ('a' as a class member) I originally put this in front and got rid of the error but the code would fail to build with no error code so I thought it was something else. http://dpaste.dzfl.pl/f4c6a503 d-ide compiles the code but says build failed and I can't execute it. Using dpaste produced the expected result... so I guess it's an issue with d-ide. | |||
July 04, 2013 Re: interface default implementation mixin | ||||
|---|---|---|---|---|
| ||||
Posted in reply to JS | On Thursday, 4 July 2013 at 19:58:11 UTC, JS wrote:
> On Thursday, 4 July 2013 at 11:32:25 UTC, Dicebot wrote:
>> On Thursday, 4 July 2013 at 11:13:54 UTC, JS wrote:
>>> I'm trying to create a default interface mixin tempate. Some prototype code I've come up with generates the members property but I get an error I don't understand:
>>>
>>> http://dpaste.dzfl.pl/58c0392d
>>>
>>> void myfunc(float a, int b, string c) { a.myfunc(a, b, c); }
>>>
>>> /d650/f247.d(70): Error: no property 'myfunc' for type 'float'
>>>
>>>
>>> The mixin doesn't seem to work properly though even though it is generating a valid implementation of the interface... unless I'm missing something.
>>
>> local variable names ('a' in function args list) shadow those in outer scopes ('a' as a class member)
>
> I originally put this in front and got rid of the error but the code would fail to build with no error code so I thought it was something else.
>
> http://dpaste.dzfl.pl/f4c6a503
>
> d-ide compiles the code but says build failed and I can't execute it. Using dpaste produced the expected result... so I guess it's an issue with d-ide.
using command line compiles fine... so it is an issue with d-ide.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply