PowerShell/PowerShellStandard

PSMemberInfo.Copy is marked "virtual" when it should be "abstract"

SeeminglyScience opened this issue · 1 comments

For example, this will compile:

using System.Management.Automation;

namespace MyNamespace
{
    internal class CustomMemberInfo : PSMemberInfo
    {
        public override PSMemberTypes MemberType => throw new System.NotImplementedException();

        public override string TypeNameOfValue => throw new System.NotImplementedException();

        public override object Value => throw new System.NotImplementedException();
    }
}

But will throw this when attempting to load the assembly in PS5.1

Method 'Copy' in type 'MyNamespace.CustomMemberInfo' from assembly
'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

This is using preview 4 for 5.1.

After adding an implementation of Copy it loads fine.

This looks to be resolved in preview.5