You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell classes still can't create value types #10669
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtime
changed the title [-]PowerShell classes still can't implement interfaces on themselves[/-][+]PowerShell classes still can't create value types[/+]on Oct 1, 2019
This works. But shouldn't. And just like Michael Klement (@mklement0) wrote, it's not the same as what you want, but a workaround. (I got seriously distracted going down the rabbit hole that is stuff not implemented by classes.)
At line:2 char:1
+ class CimObserver : Iobserver[CimInstance] {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error during creation of type "CimObserver". Error message:
Method 'OnNext' in type 'CimObserver' from assembly 'PowerShell Class Assembly, Version=1.0.0.8, Culture=neutral, PublicKeyToken=null' does not have an implementation.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtime
Activity
[-]PowerShell classes still can't implement interfaces on themselves[/-][+]PowerShell classes still can't create value types[/+]mklement0 commentedon Oct 1, 2019
It's obviously not the same, but just to mention an interim workaround: use
[object]instead of your own type.iSazonov commentedon Oct 2, 2019
/cc Patrick Meinecke (@SeeminglyScience) for reference #10623
SeeminglyScience commentedon Oct 2, 2019
Yeah this does repro without the specifics of #10623 (e.g. without the making the engine check overloads)
Presumably because it's attempting type resolution without taking the current type definition into account.
Also about valuetypes (assuming the title wasn't a mistake) #10231 is also relevant.
essentialexch commentedon Oct 2, 2019
This works. But shouldn't. And just like Michael Klement (@mklement0) wrote, it's not the same as what you want, but a workaround. (I got seriously distracted going down the rabbit hole that is stuff not implemented by classes.)
JustinGrote commentedon Jan 13, 2020
EDIT: Was case sensitive per Patrick Meinecke (@SeeminglyScience), ignore for purposes of this issue
I came across this issue trying to implement IObserver for CIM to do get-ciminstance asynchronously basically.
Unless someone can tell me what I'm doing wrong.
SeeminglyScience commentedon Jan 13, 2020
Justin Grote (@JustinGrote) Method names are case sensitive for declaration:
Though be aware that it's likely that
OnNextwill be called on a thread without a default runspace. If that's the case, the method will just throw.JustinGrote commentedon Jan 13, 2020
Patrick Meinecke (@SeeminglyScience) thanks. Believe it or not it totally worked :) Full code:
Outputted the textual representation in green to the host.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.