Jump to content

MissingMethodException: Cmps.GetEnumerator()


pether
  • Branch: Preview Branch Version: Windows Fixed

Recent changes in beta branch for Components.Cmps cause previous GetEnumerator() to be missing. As a result, all mods that iterate foreach xyz in Components.XYZs crash with "MissingMethodException: System.Collections.IEnumerator Components/Cmps`1.GetEnumerator()" error.

Mods can fix that by rebuilding with newest game files referenced, but those who won't (eg. due to author being away) will stay broken forever.

I suspect the error is introduced by change in Components.cs file, from:

public IEnumerator GetEnumerator() => this.items.GetEnumerator();

to: 

IEnumerator IEnumerable.GetEnumerator() => (IEnumerator) this.items.GetEnumerator();
IEnumerator<T> IEnumerable<T>.GetEnumerator() => (IEnumerator<T>) this.items.GetEnumerator();
public List<T>.Enumerator GetEnumerator() => this.items.GetEnumerator();

 


Steps to Reproduce

1. Try to use old mod foreaching Components on new game beta

  • Sad 2



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Changed Status to Fixed

This change was originally made to reduce memory allocations. We reviewed it again and decided to revert it.

  • Like 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...