www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics




digitalmars.D.bugs - [Issue 2026] New: Misleading error message when passing non-existent symbol to template

http://d.puremagic.com/issues/show_bug.cgi?id=2026

           Summary: Misleading error message when passing non-existent
                    symbol to template
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


Prompted by a post by Bryan Myers:

import std.string;
import std.algorithm;

void main(char[][] args)
{
    string[] words = ["c", "ab", "bb"];
    sort!("a < b", SortStrategy.stable)(words);
    assert(words == ["ab", "bb", "c"]);
}

The code uses the non-existent symbol SortStrategy.stable instead of the
correct SwapStrategy.stable. However, the error message implies that the symbol
does exist and has type int:

/home/andrei/test.d(8): template std.algorithm.sort(alias less,SwapStrategy ss
= SwapStrategy.unstable,alias iterSwap = .iterSwap,Range) does not match any
function template declaration
/home/andrei/test.d(8): template std.algorithm.sort(alias less,SwapStrategy ss
= SwapStrategy.unstable,alias iterSwap = .iterSwap,Range) cannot deduce
template function from argument types !("a < b",int)(invariant(char)[][])


-- 
Apr 23 2008