[Issue 8617] New: std.typecons.Proxy.opEquals compiles error: undefined identifier 'startsWith'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 4 01:01:28 PDT 2012


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

           Summary: std.typecons.Proxy.opEquals compiles error: undefined
                    identifier 'startsWith'
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: cpunion at gmail.com


--- Comment #0 from Li Jie <cpunion at gmail.com> 2012-09-04 01:01:56 PDT ---
--- code
struct MyString
{
    private string value;
    mixin Proxy!value;
    this(string s){ value = s; }
}

// Test BUG #
MyString a = MyString("a");
MyString b = MyString("b");
MyString a1 = MyString("a");
assert(a == a);
assert(a == a1);
assert(a != b);
---

--- compile
$ dmd testproxy.d
../src/phobos/std/typecons.d(2658): Error: undefined identifier 'startsWith'
testproxy.d(16): Error: template instance
testproxy.main.MyString.Proxy!(value).opEquals!(MyString) error instantiating
---

If the test code placed in typecons.d, it's ok.
If place it in another file, compiles error. Bug if add 'import std.algorithm',
compiles passed, why it depends user's context?

Seems it is a DMD's bug?

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


More information about the Digitalmars-d-bugs mailing list