Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
121 stars 32 forks source link

IAssetType static abstract instance fix #451

Closed Elscrux closed 1 year ago

Elscrux commented 1 year ago

Bug

The new static abstract IAssetType seems to have an issue I didn't think of before. More details can be found here. https://github.com/dotnet/csharplang/issues/5955

The result is that trying to create any data structure like this is impossible with the static abstract implementation of Instances.

static abstract IAssetType Instance { get; }

...

List<IAssetType> AssetTypes; // error (CS8920)

PR

This PR is supposed to fix this issue by making IAssetType's Instance (temporarily) virtual and adding tests to ensure everyone implements a valid Instance.