You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CodeMethod invoke fails with dot syntax but works with Foreach-Object -MemberName #4826
Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Languageparser, language semantics
This is probably an easy fix for someone interested in dynamic sites and code gen.
Taking the original repro, I've added an explanation of how the foreach example works - it's using a PSMethod which goes through reflection:
# works
$y.OpenUri.Invoke()
#works because the above works
$y | % OpenUri
#fails with No coercion operator is defined between types 'System.Void' and 'System.Object'.
$y.OpenUri()
Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Languageparser, language semantics
Activity
powercode commentedon Sep 13, 2017
It works if the
OpenUrimethod is returning something, i.e. is not a[void]return.lzybkr commentedon Sep 14, 2017
This is probably an easy fix for someone interested in dynamic sites and code gen.
Taking the original repro, I've added an explanation of how the
foreachexample works - it's using a PSMethod which goes through reflection:powercode commentedon Sep 16, 2017
PowerShellTeam I'll take a stab at it.
Call to CodeMethod returning void should work (#4850)
Call to CodeMethod returning void should work (PowerShell#4850)