Bug 11459 – std.container.Array bool constraint ambiguity

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-06T23:18:00Z
Last change time
2013-11-11T04:29:17Z
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2013-11-06T23:18:17Z
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
Comment #1 by github-bugzilla — 2013-11-10T17:18:11Z
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 Merge pull request #1682 from monarchdodra/ArrayConstraint Fix Issue 11459 - std.container.Array bool constraint ambiguity