AArnott/ImmutableObjectGraph — pull request #6 by kimbirkelund (2013-04-09 11:16:19+00:00)
Title: Changes to allow using IImmutableList<T> instead of ImmutableList<T>

First change set makes the template use IImutableList instead of ImmutableList, which in itself doesn't work because ToImmutable() cannot pass interface types variables directly to the With() method.

Second change set fixes this issue for the ToImmutable() method by explicit creating Optional instances. This issue is still present, and using the With() method with a variable typed as an interface will still not work - if it is typed as an implementation of that interface however, it does work - as illustrated by the various basket cases in Program.

Personally I prefer this drawback to being stuck with a specific implementation.