Bug 3068 – concatenation operator doesn't like typed named enums

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-06-14T10:55:02Z
Last change time
2024-12-13T17:50:15Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#17506 →

Comments

Comment #0 by dlang-bugzilla — 2009-06-14T10:55:02Z
=== Testcase === enum Enum : ubyte { Test } void main() { ubyte[] array; array = array ~ [Enum.Test]; } === Compiler output === test.d(9): Error: incompatible types for ((array) ~ ([cast(Enum)cast(ubyte)0u])): 'ubyte[]' and 'Enum[1u]' test.d(9): Error: Can only concatenate arrays, not (int ~ int) test.d(9): Error: cannot implicitly convert expression (__error ~ __error) of type int to ubyte[] === Testcase end === This seems to be a very specific bug, in that changing many of the factors allows the code to compile. For example, changing the concatenation to an append (~=) or removing the enum name (Enum) will both allow the code to compile. Removing the square brackets around Enum.Test has no effect.
Comment #1 by yebblies — 2012-02-20T04:01:10Z
Comment #2 by dlang-bugzilla — 2014-02-12T19:37:33Z
Daniel, since your pull is closed, does this make this bug a WONTFIX?
Comment #3 by yebblies — 2014-02-12T19:50:30Z
No, I think it just needs enums to be special cased and can't be done the way I attempted.
Comment #4 by robert.schadek — 2024-12-13T17:50:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17506 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB