www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16670] New: std.variant visiting allows type parameters not


          Issue ID: 16670
           Summary: std.variant visiting allows type parameters not held
                    by variant
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: nick geany.org

Algebraic!(size_t, string) variant;
    variant.visit!((void*)=>0, (size_t s)=>0, (string s)=>0);

None of the 3 visiting functions should compile because `variant` can't hold
void* or bool. Should be statically prevented to catch bugs.

Nov 08 2016