[Issue 13498] New: Return type is not checked in function template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 19 04:16:34 PDT 2014


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

          Issue ID: 13498
           Summary: Return type is not checked in function template
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: sinkuu at aol.jp

Introduced by https://github.com/D-Programming-Language/dmd/pull/3979

The code below compiles with DMD v2.067-devel-5606406.


int test1()()
{
    return "foo"; // should fail as well
}

/+
int test2()
{
    return "foo"; // Error: cannot implicitly convert expression ("foo") of
type string to int
}
+/

void main()
{
    test1();
}

--


More information about the Digitalmars-d-bugs mailing list