www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4110] New: Function template with two constraints

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4110

           Summary: Function template with two constraints
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optlink
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This D2 code is wrong:

void foo(T)(T x)
  if (is(T == int)) {
  if (!is(T == float)) {
}
void main() {
    foo(1);
}


The dmd 2.043 compiler+linker spit out:

OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 23: No Stack 
OPTLINK : Warning 134: No Start Address

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4110


Gide Nwawudu <gide nwawudu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|NEW                         |RESOLVED
                 CC|                            |gide nwawudu.com
         Resolution|                            |DUPLICATE



You missed out a brace, patch in BUG 4084 should prevent this from compiling.

*** This issue has been marked as a duplicate of issue 4084 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 24 2010