October 01, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomeksowi@gmail.com

--- Comment #11 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 3537 has been marked as a duplicate of this issue. ***

--
October 06, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=5363

--
October 07, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #12 from Walter Bright <bugzilla@digitalmars.com> ---
The problem comes from the idea that having an alias this means that operations not supported by the class get forwarded to the alias this. Since opCast() can override what explicit casts do for a class reference, the alias this needs to be respected (even if it doesn't provide an opCast(), it still can be cast).

The current behavior seems an inevitable consequence of that.

Using alias this in a class may not be a good practice.

--
October 09, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

calex <calex+bugzilla-mail@aristoweb.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |calex+bugzilla-mail@aristow
                   |                            |eb.net

--
October 10, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

--- Comment #13 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Walter Bright from comment #12)
> The problem comes from the idea that having an alias this means that operations not supported by the class get forwarded to the alias this. Since opCast() can override what explicit casts do for a class reference, the alias this needs to be respected (even if it doesn't provide an opCast(), it still can be cast).

But the only mechanism to use dynamic casting is to cast to the requested type. This is expected functionality in the class instance, and in my opinion, default functionality should override any alias this functionality.

Same thing with cast(void *). This is expected functionality.

I don't know of any other mechanism that overrides existing functionality from an alias this'd type, especially when that functionality is not intentionally specified.

For example, I would be really surprised if you had:

struct S
{
   int x;
}

struct T
{
   int y;
   S s;
   alias s this;
}

auto t = T(5, S(2));

and this failed because it's trying to call the S implicit constructor instead of the T implicit constructor.

--
October 19, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=9274

--
October 29, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |initrd.gz@gmail.com

--- Comment #14 from RazvanN <razvan.nitu1305@gmail.com> ---
*** Issue 14331 has been marked as a duplicate of this issue. ***

--
November 26, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

--- Comment #15 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/4d4cd923df4401cf4aef4744c5c122adf8aeb631 Fix Issue 6777 and 14632 - alias this disables casting for classes

https://github.com/dlang/dmd/commit/1f611ed16146eca5cdd929d0e8a615683848a4e9 Merge pull request #8712 from RazvanN7/Issue_6777

Fix Issue 6777 - alias this disables casting for classes merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>

--
November 26, 2018
https://issues.dlang.org/show_bug.cgi?id=6777

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--
1 2
Next ›   Last »