D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6494 - alias to const type in struct results in strange error
Summary: alias to const type in struct results in strange error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: diagnostic, rejects-valid
Depends on:
Blocks:
 
Reported: 2011-08-14 11:54 UTC by Trass3r
Modified: 2011-10-26 04:55 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 Trass3r 2011-08-14 11:54:17 UTC
struct Blub
{
	alias const(void*) T;

	~this() {}
	invariant() {}
}

$ dmd -c wrapper.d 
DMD v2.054 DEBUG
Error: __result = this is not mutable
Error: __result = this is not an lvalue

Somehwat related to bug 5690 but this one doesn't show an error location and there is no "real" const member, just an alias.
Comment 1 Kenji Hara 2011-08-14 12:13:08 UTC
I think this is bug 3273, and it is already fixed in master.
Your sample code pass compile with trunk dmd.