D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3215 - class method return ref but without any typename get compiled
Summary: class method return ref but without any typename get compiled
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 03:00 UTC by Sam Hu
Modified: 2015-06-09 01:28 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 Sam Hu 2009-07-30 03:00:10 UTC
With below code:
class A
{
}
class B
{
public:
ref A createA() //  ****without type name A is also OK.**** 
{
    return new A;//q1
}

}

Don't know whether this is a feature or a bug.
Comment 1 Lars T. Kyllingstad 2010-08-13 04:00:55 UTC
It's a feature. :)  When you don't specify a type, the compiler tries to deduce it automatically.