digitalmars.D.learn - Intended to be able to RefCount an interface?
- weaselcat (13/13) Feb 09 2015 Thread title.
- Jakob Ovrum (6/19) Feb 09 2015 I think this is a bug, and that the current RefCounted needs to
- weaselcat (4/30) Feb 09 2015 Is there currently an enhancement request open for this on the
- Jakob Ovrum (3/5) Feb 10 2015 I couldn't find it either, so I filed it:
Thread title. interface Itest{ } class testclass : Itest{ } void main() { import std.typecons; auto test = RefCounted!Itest(new testclass()); } If you change the refcounted to type testclass it doesn't compile because refcounted doesn't support classes. Is this a bug, or intended?
Feb 09 2015
On Tuesday, 10 February 2015 at 04:44:55 UTC, weaselcat wrote:Thread title. interface Itest{ } class testclass : Itest{ } void main() { import std.typecons; auto test = RefCounted!Itest(new testclass()); } If you change the refcounted to type testclass it doesn't compile because refcounted doesn't support classes. Is this a bug, or intended?I think this is a bug, and that the current RefCounted needs to reject interfaces. AFAIK, it is intended that RefCounted!SomeClass is supposed to reference-count the actual class instance, not its reference, which is what RefCounted!SomeInterface currently does.
Feb 09 2015
On Tuesday, 10 February 2015 at 05:09:00 UTC, Jakob Ovrum wrote:On Tuesday, 10 February 2015 at 04:44:55 UTC, weaselcat wrote:I assumed as much, thanks.Thread title. interface Itest{ } class testclass : Itest{ } void main() { import std.typecons; auto test = RefCounted!Itest(new testclass()); } If you change the refcounted to type testclass it doesn't compile because refcounted doesn't support classes. Is this a bug, or intended?I think this is a bug, and that the current RefCounted needs to reject interfaces.AFAIK, it is intended that RefCounted!SomeClass is supposed to reference-count the actual class instance, not its reference, which is what RefCounted!SomeInterface currently does.Is there currently an enhancement request open for this on the bug tracker? I cannot find anything.
Feb 09 2015
On Tuesday, 10 February 2015 at 06:26:39 UTC, weaselcat wrote:Is there currently an enhancement request open for this on the bug tracker? I cannot find anything.I couldn't find it either, so I filed it: https://issues.dlang.org/show_bug.cgi?id=14168
Feb 10 2015