Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The catch statement does not specify the type of associated exception #88

Closed
LaurentDardenne opened this issue Jul 1, 2022 · 1 comment

Comments

@LaurentDardenne
Copy link

With

catch [System.Management.Automation.CommandNotFoundException] {"Command error trapped"};catch  {"Command error trapped"}

image

While the Trap statement considers the type of the exception

trap [System.Management.Automation.CommandNotFoundException] {"Command error trapped"}

image

But in this case it is a value (a type) and not a constraint

@Jawz84
Copy link
Owner

Jawz84 commented Jul 1, 2022

Trapdoes not have an explanation in code yet, but try {}; catch {} does, I think I may have changed the behaviour there, or, possibly the type constraint is handled differently in the Ast there.
Good one. Needs further attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants