D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13806 - std.bitmanip.BitArray -- use of methods named init() messes up templates
Summary: std.bitmanip.BitArray -- use of methods named init() messes up templates
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2014-12-01 21:06 UTC by erikas.aubade
Modified: 2017-07-20 15:34 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description erikas.aubade 2014-12-01 21:06:05 UTC
It seems to be pretty common and accepted practice to use the static init field to get default values of an arbitrary templated type--however this pattern will fail hard on types like BitArray that have methods name init(), and no overloads that can be called without parameters.

It'd make life a lot easier if these methods could be renamed to something like initialize().
Comment 1 hsteoh 2014-12-16 15:54:20 UTC
IMO, proper ctors should be used instead of init(), since that is essentially what they do.
Comment 3 Peter Alexander 2015-01-11 20:09:58 UTC
Actual pull (you posted wrong link)

https://github.com/D-Programming-Language/phobos/pull/2854

:-)
Comment 4 github-bugzilla 2015-01-24 20:01:03 UTC
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/588c76c19b2619361f37084ec4bcaa95f7f03417
Merge pull request #2854 from quickfur/bitarray_init

Issue 13806: BitArray should not define member function called init()
Comment 5 hsteoh 2015-01-24 20:32:25 UTC
Are there any other instances of init abuse in Phobos, or can we close this now?
Comment 6 github-bugzilla 2015-02-18 03:41:29 UTC
Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/588c76c19b2619361f37084ec4bcaa95f7f03417
Merge pull request #2854 from quickfur/bitarray_init
Comment 7 RazvanN 2017-07-20 15:34:05 UTC
This seems to have been solved. If there are other cases of init abuse, one can always file a new bug report. Closing as fixed.