-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
7.5-regressionThe issue is a regressionThe issue is a regressionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
After i upgrade to powershell 7.5.0 yesterday i starts to notice my code base throw error: Method invocation failed because [#ClassName] does not contain a method named 'MemberwiseClone'. Also find the issue mentioned here: #24139
Expected behavior
class MyClass {
[string]$Name
[object] CloneProblem() {
return $this.MemberwiseClone()
}
}
$obj = [MyClass]::new()
$obj.CloneProblem()Actual behavior
InvalidOperation:
Line |
6 | return $this.MemberwiseClone() # Fails with "does not contai …
| ~~~~~~~~~~~~~~~~~~~~~~~
| Method invocation failed because [MyClass] does not contain a method named 'MemberwiseClone'.Error details
Exception : System.Management.Automation.RuntimeException: Method invocation failed because [MyClass]
does not contain a method named 'MemberwiseClone'.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke
clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1
variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object
input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope,
ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object
scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean
propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine,
Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsMemberFunctionT[T](Object instance,
Object[] args)
at
System.Management.Automation.Internal.ScriptBlockMemberMethodWrapper.InvokeHelperT[T](Object
instance, Object sessionStateInternal, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)Environment data
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Ubuntu 22.04.5 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
mklement0, IISResetMe, FabienTschanz, iRon7 and MarcelvEPAX8
Metadata
Metadata
Assignees
Labels
7.5-regressionThe issue is a regressionThe issue is a regressionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors