August 28, 2014 Re: Is this a bug when creating proxies in classes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Schütz | On Tuesday, 26 August 2014 at 20:41:47 UTC, Marc Schütz wrote:
> On Tuesday, 26 August 2014 at 18:13:52 UTC, Gary Willoughby wrote:
>> With that in mind what is strange is that if in my example you change the class for a struct everything works as expected. Why is that?
>
> This is bizarre... I tried a few things, but I have no idea. At first I thought the `static if` that calls `isArray` is inside another `static if`, but this is not the case.
>
> Might be a compiler bug?
Anyone else know or can reduce this if it's a bug?
|
August 28, 2014 Re: Is this a bug when creating proxies in classes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Tuesday, 26 August 2014 at 18:13:52 UTC, Gary Willoughby wrote:
> With that in mind what is strange is that if in my example you change the class for a struct everything works as expected. Why is that?
That's because when not mixed into a class, Proxy did import
std.traits:
static if (!is(typeof(this) == class))
{
private import std.traits;
|
August 28, 2014 Re: Is this a bug when creating proxies in classes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to anonymous | On Thursday, 28 August 2014 at 16:23:48 UTC, anonymous wrote:
> On Tuesday, 26 August 2014 at 18:13:52 UTC, Gary Willoughby wrote:
>> With that in mind what is strange is that if in my example you change the class for a struct everything works as expected. Why is that?
>
> That's because when not mixed into a class, Proxy did import
> std.traits:
>
> static if (!is(typeof(this) == class))
> {
> private import std.traits;
Ah right, yes. ta.
|
October 16, 2014 Re: Is this a bug when creating proxies in classes? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Monday, 25 August 2014 at 18:10:33 UTC, Gary Willoughby wrote: > class Foo > { > private int foo; > > mixin Proxy!(foo); > > this(int x) > { > this.foo = x; > } > } Apparently Proxy doesn't work correctly inside classes. Is wrapping something inside a class particularly useful? Please comment on https://issues.dlang.org/show_bug.cgi?id=13623. |
Copyright © 1999-2021 by the D Language Foundation