[Issue 1735] classinfo.create returns null if no default constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 16 19:36:05 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1735





------- Comment #1 from dhasenan at gmail.com  2007-12-16 21:36 -------
This is an interesting situation. Related to #1712 -- you can't fake the
functionality because of interfaces. Otherwise, it's a pretty dangerous
situation to create an instance of a class without calling the constructor.

I'd say the default action should be throwing an exception if there is no
default constructor. It would be convenient to have an official, endorsed
method for getting an object of a given type without calling the constructor,
though.


-- 



More information about the Digitalmars-d-bugs mailing list