Note: If #9701 is implemented, this issue becomes moot.
class Foo {
# This method definition shouldn't be permitted, because optional parameters
# aren't supported.
[string] Bar($Baz = 'Bam') { return $Baz }
}
[Foo]::new().Bar()
The class definition should fail, given that optional parameters aren't supported.
The class definition succeeds, but the argument-less invocation of the method fails.
Cannot find an overload for "Bar" and the argument count: "0".
PowerShell Core 6.2.1
If we implement this error message it will 75% from implementing the feature :-)
Yeah, in truth if we're going to be poking around here I'd rather we make this work properly.
I didn't realize that was on the menu.
I'll have the feature then, please :)
Maybe reopen with the feature request?
Good idea; please see #9701
@mklement0 Thanks! I think we can close the issue.
Most helpful comment
Yeah, in truth if we're going to be poking around here I'd rather we make this work properly.