Bug 17876 – [REG 2.074] Internal error when comparing inout(Foo[][]) with Foo[][]
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-10-04T19:44:02Z
Last change time
2017-10-09T16:52:22Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Christian DurĂ¡n
Comments
Comment #0 by ovejacuantica — 2017-10-04T19:44:02Z
Not sure if a problem with phobos or druntime.
import std.container.rbtree;
void main () {
auto a = redBlackTree!(size_t [][]);
}
With command 'dmd file' or 'ldc file' (DMD 2.076.0 and LDC 1.4.0) gives:
/usr/include/dlang/dmd/object.d(3462): Error: static assert "Internal error."
/usr/include/dlang/dmd/std/functional.d-mixin-201(201): instantiated from here: __cmp!(const(ulong[]), ulong[])
/usr/include/dlang/dmd/std/container/rbtree.d(866): instantiated from here: binaryFun!(inout(ulong[][]), ulong[][])
/usr/include/dlang/dmd/std/container/rbtree.d(1832): instantiated from here: RedBlackTree!(ulong[][], "a < b", false)
Comment #1 by ovejacuantica — 2017-10-04T19:52:32Z
Probably just needs a better error message because it seems to happen because there's no ordering for the type.
Comment #2 by ag0aep6g — 2017-10-04T20:37:30Z
Reduced (it's the result of using `binaryFun!"a < b"` in the `inout` method `_firstGreaterEqual`):
----
bool _less(inout size_t[][] a, size_t[][] b) { return a < b; }
----
I don't know if this should compile or throw an error. Any way, it shouldn't ICE.
dmd2.073.0 accepts the code, making this a regression.
Changing component to dmd as that's where the bug manifests as an ICE. The actual bug might be in druntime.
Comment #3 by schveiguy — 2017-10-05T13:24:44Z
this should compile, size_t[][] has a valid ordering.
If the ice is fixed, and this doesn't compile, please file another bug report.