Issue 15017 - [REG2.068.1-b2] assigning a Variant to be value in a hashmap
Summary: [REG2.068.1-b2] assigning a Variant to be value in a hashmap
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 regression
Assignee: No Owner
URL: http://dlang.org/
Keywords: link-failure, pull
Depends on:
Blocks:
 
Reported: 2015-09-05 16:23 UTC by Dylan Knutson
Modified: 2015-09-07 13:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dylan Knutson 2015-09-05 16:23:10 UTC
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 Dylan Knutson 2015-09-05 16:25:11 UTC
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 Dylan Knutson 2015-09-05 16:33:57 UTC
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 4 github-bugzilla 2015-09-06 11:22:26 UTC
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 github-bugzilla 2015-09-07 13:37:04 UTC
Commits pushed to master 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