[Issue 15063] New: Template Instantiation Accepts Invalid Code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 15 12:33:18 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15063

          Issue ID: 15063
           Summary: Template Instantiation Accepts Invalid Code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com

The following code should not compile, as the call to test1 matches both
overloads.


import std.typecons : Flag;

void test1(alias pred="a == b", T)(T a) {}

alias SomeFlag = Flag!"SomeFlag";
void test1(SomeFlag allocate_gc = SomeFlag.no, T)(T a) {}

void main()
{
    test1(1);
}

--


More information about the Digitalmars-d-bugs mailing list