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