We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b20c81 commit 423dec5Copy full SHA for 423dec5
Transpilers/Keywords/New.psx.ps1
@@ -97,7 +97,13 @@ process {
97
$constructorArguments[0] -is [string]) {
98
"[$newTypeName]::parse(" + ($constructorArguments -join ',') + ")"
99
} elseif ($realNewType::new) {
100
- "[$newTypeName]::new(" + ($constructorArguments -join ',') + ")"
+ if ($constructorArguments) {
101
+ "[$newTypeName]::new(" + ($constructorArguments -join ',') + ")"
102
+ } elseif ($realNewType::new.overloadDefinitions -notmatch '\(\)$') {
103
+ "[$newTypeName]::new(`$null)"
104
+ } else {
105
+ "[$newTypeName]::new()"
106
+ }
107
} elseif ($realNewType.IsPrimitive) {
108
if ($constructorArguments) {
109
if ($constructorArguments.Length -eq 1) {
0 commit comments