[Issue 11459] New: std.container.Array bool constraint ambiguity

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 6 23:18:19 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11459

           Summary: std.container.Array bool constraint ambiguity
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-11-06 23:18:17 PST ---
The current constraint pair is:

if (!is(T  : const(bool))
and
if ( is(T == bool)

This means that it is not possible to instantiate an Array with anything that
is implicitly convertible to a bool, but isn't "bool":

//--------
import std.container;

struct S
{
  bool b;
  alias b this;
}

void main()
{
  alias A = Array!S;
  alias B = Array!(const bool);
}

main.d(11): Error: struct std.container.Array does not match any template
declaration
main.d(12): Error: struct std.container.Array does not match any template
declaration

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


More information about the Digitalmars-d-bugs mailing list