Bug 8096 – Useless error when gagged error destroys type of nested union
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-15T04:56:00Z
Last change time
2013-07-13T23:04:46Z
Keywords
diagnostic
Assigned to
clugdbug
Creator
yebblies
Comments
Comment #0 by yebblies — 2012-05-15T04:56:09Z
dmd 2.060 head
--------------------
import std.datetime;
import std.typecons;
import std.variant;
void main()
{
Variant data;
data.get!(Tuple!SysTime);
}
--------------------
testx.d(9): Error: cannot resolve type for data.get!(Tuple!(SysTime))
testx.d(9): Error: dotti has no effect in expression (data.get!(Tuple!(SysTime))
)
--------------------
Variant.get creates a nested union which attempts to build an opEquals, which fails because Tuple's opEquals is not const. This error is swallowed by the gagging system, with Variant.get.Buf's type being set to _error_, causing the above useless error message.
I have no idea why SysTime is required. It can be worked around in this instance by making Tuple.opEquals const
Assigned to Don because it seems related to the gagging system.