Bug 14586 – can't get an immutable value from a const std.variant.Variant
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-15T12:47:00Z
Last change time
2017-07-19T17:43:23Z
Assigned to
nobody
Creator
ag0aep6g
Comments
Comment #0 by ag0aep6g — 2015-05-15T12:47:46Z
----
import std.variant;
void main()
{
const Variant v = new immutable Object;
auto o = v.get!(immutable Object); /* line 5 */
}
----
test.d(5): Error: mutable method std.variant.VariantN!32LU.VariantN.get!(immutable(Object)).get is not callable using a const object
----
Pull request on the way.
Comment #1 by github-bugzilla — 2015-05-17T01:22:11Z