www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11481] New: Clearly note all explicit casts are forwarded to `alias this` if there is no `opCast`

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11481

           Summary: Clearly note all explicit casts are forwarded to
                    `alias this` if there is no `opCast`
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: major
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



16:39:36 MSK ---
People tend to think explicit cast behaves as no-op if there is an implicit
one. Documentation must clearly note it's wrong and `opCast` is tried to be
called.

Also a list of operations rewritten as explicit cast like `if(someStruct)` must
be provided as people tend to forget invisible explicit casts exist.

Appendix:
* Filed invalid bugs because of this: Issue 3537, Issue 6777, Issue 7985, Issue
9151.
* Lockup mechanics explanation by Kenji Hara: Comment 2 of Issue 11161.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2013
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11481


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch




 People tend to think explicit cast behaves as no-op if there is an implicit
 one. Documentation must clearly note it's wrong and `opCast` is tried to be
 called.
 
 Also a list of operations rewritten as explicit cast like `if(someStruct)` must
 be provided as people tend to forget invisible explicit casts exist.
 
 Appendix:
 * Filed invalid bugs because of this: Issue 3537, Issue 6777, Issue 7985, Issue
 9151.
Issue 9151 is the only instance of this. Simply adding an alias this must not result in hijacking, so the current behaviour is unacceptable for the other issues.
 * Lockup mechanics explanation by Kenji Hara: Comment 2 of Issue 11161.
How exactly DMD derives unreasonable behaviour is not relevant for answering the question whether the behaviour is reasonable. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2013