Bug 15017 – [REG2.068.1-b2] assigning a Variant to be value in a hashmap

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-05T16:23:00Z
Last change time
2015-09-07T13:37:04Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
tcdknutson

Comments

Comment #0 by tcdknutson — 2015-09-05T16:23:10Z
It seems that Phobos no longer handles a variant being assigned to a value in a hashmap. Tested to be working in v2.068.0. Reduced test case: ``` import std.variant ; class TempleContext { // context variables Variant[string] vars; ref var(string name) { vars[name] = Variant(); } } ```
Comment #1 by tcdknutson — 2015-09-05T16:25:11Z
Failure error from DMD: ``` /Users/dymk/Downloads/dmd2/osx/bin/../../src/phobos/std/variant.d: Error: function std.variant.VariantN!32LU.VariantN.__xopEquals errors compiling the function ```
Comment #2 by tcdknutson — 2015-09-05T16:33:57Z
Reduced variant.d ``` template maxSize(T...) { enum maxSize = T[0].sizeof; } struct VariantN(size_t maxDataSize, AllowedTypesParam...) { // Allow assignment from another variant which is a subset of this one VariantN opAssign() { } // returns 1 if the two are equal bool opEquals(T)(T ) { } } alias Variant = VariantN!(maxSize!creal); ```
Comment #3 by k.hara.pg — 2015-09-06T07:02:58Z
Comment #4 by github-bugzilla — 2015-09-06T11:22:26Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4a87ff64dfdc67419a69136ce542e88c67726701 fix Issue 15017 - assigning a Variant to be value in a hashmap https://github.com/D-Programming-Language/dmd/commit/c9c12bf14b054a589841a2a62f083106c8647fb5 Merge pull request #5042 from 9rnsr/fix15017 [REG2.068.1-b2] Issue 15017 - assigning a Variant to be value in a hashmap
Comment #5 by github-bugzilla — 2015-09-07T13:37:04Z