www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7450] New: AA: Cannot uniquely infer foreach argument types

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

           Summary: AA: Cannot uniquely infer foreach argument types
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



01:45:43 PST ---
void main()
{
    string[string] hash;
    hash["foo"] = "";

    foreach (name; hash.byKey())
    {
        assert(typeid(string) == typeid(name));  // ok
    }

    // Error: cannot uniquely infer foreach argument types
    foreach (string name; hash.byKey())
    {
    }
}

I'm confused, why can't I specify the type? It ends up being a string if I
don't set it..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7450


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
This compiles and runs with 2.059.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7450


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



15:44:22 PDT ---
Hmm.. I can't recreate this in 2.057 either. It does crash DMD 2.053 though, so
it might have been some kind of lurking bug somewhere.. I'll close it now
though.

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