ETS CodeMethod is always attempted even if the argument count is incorrect, and silently discards extra arguments
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by running the PowerShell reproduction and compare the four observed results with the expected behavior. Trace the CodeMethod invocation and its argument-count handling, then find the existing tests for this entry point. Done means incorrect argument counts produce errors, while valid counts call the appropriate method without discarding extra arguments.
Written by the indexing model from the issue text.
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
class Example
{
static [string] Bar([psobject]$this_, [int]$first)
{
Return "Bar($first)";
}
[string] Foo([int]$first, [int]$second)
{
Return "Foo($first, $second)";
}
}
Update-TypeData -TypeName ([Example].FullName) `
-MemberType 'CodeMethod' -MemberName 'Foo' `
-Value ([Example].GetMethod('Bar'));
Write-Verbose '[Example]::new().Foo()' -Verbose;
[Example]::new().Foo();
Write-Verbose '[Example]::new().Foo(1)' -Verbose;
[Example]::new().Foo(1);
Write-Verbose '[Example]::new().Foo(1, 2)' -Verbose;
[Example]::new().Foo(1, 2);
Write-Verbose '[Example]::new().Foo(1, 2, 3)' -Verbose;
[Example]::new().Foo(1, 2, 3);
Expected behavior
Error
Bar(1)
Foo(1, 2)
Error
Actual behavior
Error (cannot convert DBNull to int)
Bar(1)
Bar(1)
Bar(1)
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.6.6
PSEdition Core
GitCommitId 7.6.6
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
- Dominant language
- C#
- Stars
- 56.1k
- Forks
- 8.5k
- Avg merge
- 12h 33m
- Merged PRs (30d)
- 73
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PowerShell
-
Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
PowerShell/PowerShell#28432 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Needs-Investigation WG-Engine WG-NeedsReview
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PowerShell/PowerShell#28283 · 1 comment ·
Maintainers usually reply within 1 day
-
Contributing tab on rendered Readme.md has broken links to two images, under .github/Images, but previews ok in .github/Contributing.mdPossibly taken @Soumilgit claimed this 22 days ago. OpenIssue-Enhancement Needs-Triage
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
PowerShell/PowerShell#28256 · 1 comment ·
Maintainers usually reply within 1 day
-
Issue-Enhancement Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PowerShell/PowerShell#28138 · 1 reaction ·
Maintainers usually reply within 1 day
-
Add support for WebRequestMethod QUERYPossibly taken @soroshsabz claimed this 52 days ago. OpenIssue-Enhancement Up-for-Grabs WG-Cmdlets WG-Reviewed
Difficulty 1/5 Under an hour Newbie friendliness 86/100
PowerShell/PowerShell#28061 · 4 comments · 3 reactions ·
Maintainers usually reply within 1 day
All issues in PowerShell/PowerShell
Similar issues
-
area-templates triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/aspire#22356 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/aspire.dev#2184 ·
Maintainers usually reply within 2 days
-
area-controls-refreshview platform/ios s/triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dotnet/maui#40314 · 1 reaction ·
Maintainers usually reply within 1 day
-
Needs: Triage (Functions) v5 v5-preview5
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Azure/azure-functions-core-tools#5918 ·
Maintainers usually reply within 1 day
-
kind:ux needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elsa-workflows/elsa-foundation#4712 · 1 comment ·
Maintainers usually reply within 1 day