This project is read-only.


Immutable Data Structures constructors


Importan bug in all the Immutable Data Structures, the constructor is not private
Closed Nov 30, 2009 at 4:22 PM by


Olmo wrote Nov 30, 2009 at 4:22 PM

Upsy.... It's fixed now. Will be up for the next version

Olmo wrote Nov 30, 2009 at 4:33 PM

Mmmm, really is not a bug. The only public constructor belongs to the private neasted classes inside the Immutable Data Structures. So the constructor is public only to the parent class, but not to the client code :)
public class ImmutableStack:IEnumerable
    private class ImmutableFullStack : ImmutableStack
        readonly T head;
        readonly ImmutableStack tail;

        public ImmutableFullStack(T head, ImmutableStack tail)
            this.head = head;
            this.tail = tail;