Bug 3215 – class method return ref but without any typename get compiled

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-07-30T03:00:00Z
Last change time
2015-06-09T01:28:06Z
Assigned to
nobody
Creator
samhu.samhu

Comments

Comment #0 by samhu.samhu — 2009-07-30T03:00:10Z
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 by bugzilla — 2010-08-13T04:00:55Z
It's a feature. :) When you don't specify a type, the compiler tries to deduce it automatically.