Thread overview
[Issue 20920] Typedef!int + Typedef!int => int? is this a typedef overlook?
Dec 17, 2022
Iain Buclaw
Oct 18, 2023
mw
Oct 18, 2023
mw
Oct 30, 2023
mw
Oct 30, 2023
mw
June 11, 2020
https://issues.dlang.org/show_bug.cgi?id=20920

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Typedef was meant to replace the deprecated typedef feature.

If you look at D1's spec https://digitalmars.com/d/1.0/type.html, it claims that if two identical typedefs are the parameters to a binary arithmetic operator, the result should be the same type.

This works today with enums as well. This should be how Typedef operates.

The solution may be tricky, because one has to define opBinary for the specific type, but must forward to the base type if there is no match.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20920

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--
October 18, 2023
https://issues.dlang.org/show_bug.cgi?id=20920

--- Comment #2 from mw <mingwu@gmail.com> ---
Created attachment 1894
  --> https://issues.dlang.org/attachment.cgi?id=1894&action=edit
s7.i.gz attached. dmd s7.i shows the same error.

s7.i.gz attached.

dmd s7.i shows the same error.

--
October 18, 2023
https://issues.dlang.org/show_bug.cgi?id=20920

--- Comment #3 from mw <mingwu@gmail.com> ---
Comment on attachment 1894
  --> https://issues.dlang.org/attachment.cgi?id=1894
s7.i.gz attached. dmd s7.i shows the same error.

wrong operation, this is for issue #24187

--
October 30, 2023
https://issues.dlang.org/show_bug.cgi?id=20920

--- Comment #4 from mw <mingwu@gmail.com> ---
Created attachment 1896
  --> https://issues.dlang.org/attachment.cgi?id=1896&action=edit
reduced to 2 lines: s2.i

--
October 30, 2023
https://issues.dlang.org/show_bug.cgi?id=20920

--- Comment #5 from mw <mingwu@gmail.com> ---
wrong operation, this is for issue #24187

--