Make the parameter 'args' no-nullable in the public ConsoleHost APIs#13429
Make the parameter 'args' no-nullable in the public ConsoleHost APIs#13429rjmholt merged 3 commits intoPowerShell:masterfrom
ConsoleHost APIs#13429Conversation
|
@PoshChan please remind me in 24 hours |
.Net team confirmed that it is not null for Main() - right signature |
Why is that? Yes, there is a null assignment in
|
It is a public API too :-) It would be not right using but possible. |
What is desired behavior for null? Throw? |
True, but it's less likely to be used like the
Yes, throw, but with |
|
@rjmholt, this is the reminder you requested 24 hours ago |
|
🎉 Handy links: |
PR Summary
This is a follow-up on #11482
We actually don't expect
argsto containnullvalue in it. For example, the use ofargsinGetSwitchKeyat here indicates we are not expecting an element ofargsisnull, and many other places likeParseFile./cc @iSazonov Maybe we should validate if
argscontains anynullelements, maybe that's not necessary given it has been working fine so far, but either way, I'm deferring that to a separate PR.PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.