Bug 13158 – "void has no value" in std.variant.Algebraic (affects D:YAML)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-19T01:04:00Z
Last change time
2014-08-22T08:04:48Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
kiithsacmp

Comments

Comment #0 by kiithsacmp — 2014-07-19T01:04:45Z
I started testing 2.066b4 and noticed that my library D:YAML is broken. I minimized the cause of the bug to the following: ============================== import std.variant; struct Node { struct Pair { Node value; } alias Algebraic!(Node[], int) Value; } void main(string[] args) { } ============================== This compiles with DMD 2.065 and doesn't compile with 2.066b4. It seems to break at std.variant.maxSize. Build log: ============================== /home/kiith-sa/Programming/D/Compilers/dmd2066-beta/linux/bin64/../../src/phobos/std/variant.d(84): Error: void has no value /home/kiith-sa/Programming/D/Compilers/dmd2066-beta/linux/bin64/../../src/phobos/std/variant.d(84): Error: incompatible types for ((16LU) >= (maxSize!int)): 'ulong' and 'void' /home/kiith-sa/Programming/D/Compilers/dmd2066-beta/linux/bin64/../../src/phobos/std/variant.d(1245): Error: template instance std.variant.maxSize!(Node[], int) error instantiating bug.d(10): instantiated from here: Algebraic!(Node[], int) /home/kiith-sa/Programming/D/Compilers/dmd2066-beta/linux/bin64/../../src/phobos/std/variant.d(1245): Error: template instance VariantN!(maxSize!(Node[], int), Node[], int) does not match template declaration VariantN(ulong maxDataSize, AllowedTypesX...) ============================== This compiles without an error with 2.066b4 (as well as 2.065): ============================== import std.variant; struct Pair { Node value; } struct Node { alias Pair = .Pair; alias Algebraic!(Node[], int) Value; } void main(string[] args) { } ==============================
Comment #1 by dlang-bugzilla — 2014-07-20T09:07:38Z
Comment #2 by k.hara.pg — 2014-07-21T16:32:11Z
Comment #3 by github-bugzilla — 2014-07-21T23:06:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/75ffb6305b38edb05e4f132de7795e93df75a579 fix Issue 13158 - "void has no value" in std.variant.Algebraic (affects D:YAML) https://github.com/D-Programming-Language/dmd/commit/5d2848581528e10f8e71e71ce90bc22bf0962ab7 Merge pull request #3793 from 9rnsr/fix13158 [REG2.066a] Issue 13158 - "void has no value" in std.variant.Algebraic (affects D:YAML)
Comment #4 by github-bugzilla — 2014-07-23T15:35:36Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2b6d7091f9407bc2fc855b050d15a0cb11ca572c Merge pull request #3793 from 9rnsr/fix13158 [REG2.066a] Issue 13158 - "void has no value" in std.variant.Algebraic (affects D:YAML)
Comment #5 by github-bugzilla — 2014-08-22T08:04:48Z