grzesiek-galezowski/tdd-toolkit

Any.Instance should avoid copy-constructor if possible

Closed this issue · 2 comments

Check this with a test, currently I think this throws exception

The real problem is when copy constructor is the only public one and there is a static factory method. Ideally, the last resort should be to look for static factory method first before attempting to use a constructor with recursion.

Added better heuristics