D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17240 - mutable/shared @property both match in typeof
Summary: mutable/shared @property both match in typeof
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 blocker
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-02 13:55 UTC by John Colvin
Modified: 2022-11-18 09:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description John Colvin 2017-03-02 13:55:28 UTC
struct S
{
	import std.stdio;
	int b() @property        { return 0; }
	int b() @property const  { return 0; }
	int b() @property shared { return 0; }
}

alias T = typeof(S.b);

/d746/f453.d(9): Error: f453.S.b called with argument types () matches both:
/d746/f453.d(4):     f453.S.b()
and:
/d746/f453.d(6):     f453.S.b()

The problem doesn't occur without @property, whether or not () are included in the typeof expression.

The clash is to do with shared. const/shared clash, as do mutable/shared, but mutable/const is fine.

In order to add typeof(AggregateType.member) support to std.typecons.Proxy (with knockon improvements to a few other things in std.typecons), either this bug or https://issues.dlang.org/show_bug.cgi?id=17239 needs resolving.
Comment 1 RazvanN 2022-11-18 09:54:34 UTC
I cannot reproduce this. Compiling the code with git master yields a successful compilation.