www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11603] New: Refused std.algorithm.canFind on an array of enums

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

           Summary: Refused std.algorithm.canFind on an array of enums
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-11-25 10:03:53 PST ---
I think used to work in dmd v2.063.2:



import std.algorithm: canFind;
void main() {
    enum Foo { x }
    [Foo.x].canFind(Foo.x);
}


With dmd 2.065alpha it gives:

...\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(3834): Error: template
instance std.traits.isSomeChar!(Foo) recursive expansion

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
          Component|Phobos                      |DMD
           Platform|x86                         |All
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-12-03 17:03:29 PST ---
*** This issue has been marked as a duplicate of issue 11610 ***

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


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |


--- Comment #2 from bearophile_hugs eml.cc 2013-12-03 18:47:08 PST ---
I think the problem is not yet solved, see:


void main() {
    import std.algorithm: canFind;
    enum Foo : ubyte { A }
    assert([Foo.A].canFind(Foo.A));
}

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|DMD                         |Phobos
            Summary|Refused                     |std.algorithm.canFind does
                   |std.algorithm.canFind on an |not work when needle is
                   |array of enums              |1-byte zero
         OS/Version|Windows                     |All


--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2013-12-03 23:22:56 PST ---
(In reply to comment #2)
 I think the problem is not yet solved, see:
 
 
 void main() {
     import std.algorithm: canFind;
     enum Foo : ubyte { A }
     assert([Foo.A].canFind(Foo.A));
 }

This is a Phobos regression caused by: https://github.com/D-Programming-Language/phobos/pull/1492 I commented about the bug on github. https://github.com/D-Programming-Language/phobos/pull/1492/files#r8087442 Reused this issue number for the Phobos bug, and changed the summary. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 03 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11603



--- Comment #4 from Kenji Hara <k.hara.pg gmail.com> 2013-12-03 23:29:31 PST ---
https://github.com/D-Programming-Language/phobos/pull/1744

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



--- Comment #5 from github-bugzilla puremagic.com 2013-12-04 00:08:11 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ab34fb92addca61755474df04a0d0d6e0f1148a2
fix Issue 11603 - std.algorithm.canFind does not work when needle is 1-byte
zero

https://github.com/D-Programming-Language/phobos/commit/c98f5f58114b798f51f40bf837f924e2afa3f646
Merge pull request #1744 from 9rnsr/fix11603

Issue 11603 - std.algorithm.canFind does not work when needle is 1-byte zero

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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



--- Comment #6 from github-bugzilla puremagic.com 2013-12-09 04:04:51 PST ---
Commit pushed to 2.065 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/761dd246ee900118ff14c35d7b2680f8abea16c6
Merge pull request #1744 from 9rnsr/fix11603

Issue 11603 - std.algorithm.canFind does not work when needle is 1-byte zero

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



--- Comment #7 from github-bugzilla puremagic.com 2013-12-19 06:49:35 PST ---
Commits pushed to 2.065 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ab34fb92addca61755474df04a0d0d6e0f1148a2
fix Issue 11603 - std.algorithm.canFind does not work when needle is 1-byte
zero

https://github.com/D-Programming-Language/phobos/commit/c98f5f58114b798f51f40bf837f924e2afa3f646
Merge pull request #1744 from 9rnsr/fix11603

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



--- Comment #8 from github-bugzilla puremagic.com 2013-12-19 07:01:27 PST ---
Commit pushed to 2.065 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/13b8101061b2e5824c0e0a08654922649acf4978
Merge pull request #1744 from 9rnsr/fix11603

Issue 11603 - std.algorithm.canFind does not work when needle is 1-byte zero

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



--- Comment #9 from github-bugzilla puremagic.com 2014-01-15 11:41:32 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/13b8101061b2e5824c0e0a08654922649acf4978
Merge pull request #1744 from 9rnsr/fix11603

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