-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics
Description
Steps to reproduce
Derive from a class with virtual protected internal method. For example, System.Diagnostics.Tracing.EventListener, System.Net.Http.DelegatingHandler.
Override that method.
Call that method of base class.
Add-Type -TypeDefinition @'
public class BaseMembersTestClass
{
protected internal virtual int TestMethod()
{
return 1001;
}
}
'@
$derived = Invoke-Expression @'
class BaseCallTestClass : BaseMembersTestClass
{
[int] TestMethod()
{
return 3 * ([BaseMembersTestClass]$this).TestMethod()
}
}
[BaseCallTestClass]::new()
'@
$derived.TestMethod()Expected behavior
Method of base class should be called.
Actual behavior
Overridden implementation called recursively until
Process is terminating due to StackOverflowException.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.3
PSEdition Core
GitCommitId v6.0.3
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics