-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIn-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Steps to reproduce
class TestClass {
[string] hidden $prop
[string]Prop() {
return $this.prop
}
}
$obj = [TestClass]::new()Expected behavior
Get an error saying you can't have a property and a method with the same name
Actual behavior
PS C:\EDICore> $obj | Get-Member
TypeName: TestClass
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
Prop Method string Prop()
ToString Method string ToString()
PS C:\EDICore> $obj.Prop()
Method invocation failed because [TestClass] does not contain a method named 'Prop'.
At line:1 char:1
+ $obj.Prop()
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFoundEnvironment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 6.1.7601 S
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIn-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime