D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3641 - alias shared T U does not work
Summary: alias shared T U does not work
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-12-23 17:30 UTC by Jason House
Modified: 2015-06-09 01:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jason House 2009-12-23 17:30:47 UTC
Sample code
========================
class foo{}
void main(){
	alias shared foo bar; // results in error
	//alias shared(foo) bar; // works
	shared(foo) x = new bar();
}
========================

Result with dmd 2.037
(Bug report lists dmd 2.036 since 2.037 was not an option at the time)

$ dmd test.d
test.d(4): Error: cannot implicitly convert expression (new foo) of type test.foo to shared(foo)
Comment 1 Leandro Lucarella 2009-12-25 10:01:25 UTC
http://www.dsource.org/projects/dmd/changeset/307
Comment 2 Walter Bright 2009-12-31 11:22:42 UTC
Fixed dmd 2.038