Bug 21966 – elem ~ elem could yield elem[]

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-25T12:46:31Z
Last change time
2024-12-13T19:16:38Z
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: dmd#18036 →

Comments

Comment #0 by b2.temp — 2021-05-25T12:46:31Z
idea hidden in DMD compiler --- void main() { char[] ab = 'a' ~ 'b'; int[] z1 = 0 ~ 1; } --- CatExp of two compatible elems could result into a dynamic array, instead of the current errors: >/tmp/temp_7F4CF56284B0.d:5:17: Error: incompatible types for `(cast(int)'a') ~ (cast(int)'b')`: both operands are of type `int` >/tmp/temp_7F4CF56284B0.d:6:17: Error: incompatible types for `(0) ~ (1)`: both operands are of type `int`
Comment #1 by dlang-bot — 2021-05-25T12:50:48Z
@TungstenHeart created dlang/dmd pull request #12583 "remove comment that is now known as issue 21966" mentioning this issue: - remove comment that is now known as issue 21966 https://github.com/dlang/dmd/pull/12583
Comment #2 by b2.temp — 2021-05-25T13:00:29Z
the char case is particularly nasty, the integer promotion hits badly the intention.
Comment #3 by dlang-bot — 2021-05-25T13:45:36Z
dlang/dmd pull request #12583 "remove comment that is now known as issue 21966" was merged into master: - ed52541c4f8de2996e0d88fec4dcc67f4a7a56b7 by TungstenHeart: remove comment that is now known as issue 21966 https://github.com/dlang/dmd/pull/12583
Comment #4 by dlang-bot — 2021-07-07T13:46:17Z
@ibuclaw updated dlang/dmd pull request #12798 "Issue 21488 - Always compile dmd with -fPIC on POSIX targets" mentioning this issue: - remove comment that is now known as issue 21966 https://github.com/dlang/dmd/pull/12798
Comment #5 by robert.schadek — 2024-12-13T19:16:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18036 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB