"Method 'Reset' not found in base class" for TAbstractReadOnlyList<T>.TEnumerator.Reset

Issue #340 invalid
Илья Ненашев created an issue

Occasionally I’ve included unit spring4d\Source\Base\Collections\Spring.Collections.ReadOnlyLists.pas to

my project and at lines

type
  TAbstractReadOnlyList<T> = class(TEnumerableBase<T>, IReadOnlyList<T>)
  private
    type
      TEnumerator = class(TEnumeratorBase<T>)
...
        procedure Reset; override;
                         ^^^^^- error!

got an error:

[dcc32 Error] Spring.Collections.ReadOnlyLists.pas(53): E2137 Method 'Reset' not found in base class

Comments (1)

  1. Stefan Glienke repo owner

    Reset method was removed from enumerator some while ago in 1.2.1 already.

    And that unit has been removed in develop.

    If you need a readonly view on a list you can get the IReadOnlyList<T> via AsReadOnly method from an IList<T>.

  2. Log in to comment