Prerequisites
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
Prerequisites
Steps to reproduce
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response