www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11459] New: std.container.Array bool constraint ambiguity

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: monarchdodra gmail.com



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: -------
Nov 06 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11459




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/0e73c50ba2dede6a8549eb560581fd11f2351eb2
Fix Issue 11459 - std.container.Array bool constraint ambiguity

https://github.com/D-Programming-Language/phobos/commit/ec25c68f47488cfed8e907bed8b05274dbd9b012


Fix Issue 11459 - std.container.Array bool constraint ambiguity

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 10 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11459


monarchdodra gmail.com changed:

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


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