Summary of the new feature/enhancement
#9684 shows that while you can declare optional parameters, they are in effect mandatory, and the default value is ignored.
Reporting an error when an attempt is made to declare an optional parameter is one solution, but a better option is to enable proper support for optional method parameters, so that the following would work:
# Wishful thinking
PS> class Foo { [string] Bar($Baz = 'Bam') { return $Baz } }; [Foo]::new().Bar()
Bam
Summary of the new feature/enhancement
#9684 shows that while you can declare optional parameters, they are in effect mandatory, and the default value is ignored.
Reporting an error when an attempt is made to declare an optional parameter is one solution, but a better option is to enable proper support for optional method parameters, so that the following would work: