relax disabled Final!T unary operators
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Wed Mar 29 14:04:44 PDT 2017
On Wed, Mar 29, 2017 at 08:11:11PM +0000, via Digitalmars-d wrote:
[...]
> As I explained in the bug report
> (https://issues.dlang.org/show_bug.cgi?id=17284) the particular
> @safe-ty issue has nothing to do with Final.
You're right. It seems that the problem is caused by the compiler
forgetting to check for overlapping pointer fields when inferring @safe
for template functions. Which isn't specific to Final.
> That said, I agree that Final is wrongly designed. In fact I argued
> that it should reject structs even before the PR was merged, but I
> didn't have much free time time to defend my position back then:
> https://github.com/dlang/phobos/pull/3862#issuecomment-199164913
While arguments could be made for supporting structs in some way, I
think a good first step, since after all this *is* std.experimental, is
to add a sig constraint to Final to make it reject everything except
pointers, classes, and interfaces.
Then in the meantime we can debate over whether / how to implement Final
for other types.
T
--
Only boring people get bored. -- JM
More information about the Digitalmars-d
mailing list