IDictionary -> IDictionary<string, FunctionInfo> for FunctionTable#12658
IDictionary -> IDictionary<string, FunctionInfo> for FunctionTable#126583 commits merged intoPowerShell:masterfrom
Conversation
f63aa7f to
6667d89
Compare
| WildcardOptions.IgnoreCase); | ||
|
|
||
| foreach (DictionaryEntry functionEntry in _context.EngineSessionState.GetFunctionTable()) | ||
| foreach (var functionEntry in _context.EngineSessionState.GetFunctionTable()) |
There was a problem hiding this comment.
The type is not obvious. Please replace var with explicit type.
There was a problem hiding this comment.
Maybe
ExecutionContext context = _context;
SessionStateInternal sessionState = context.EngineSessionState;
IDictionary<string, FunctionInfo> functionTable = sessionState.GetFunctionTable();
foreach (KeyValuePair<string, FunctionInfo> functionEntry in functionTable)
{
...The types are not obvious in _context.EngineSessionState.GetFunctionTable() either...
There was a problem hiding this comment.
_context.EngineSessionState is common pattern in Engine. .For the small refactor I thing it makes sense only replace var with type.
src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
Outdated
Show resolved
Hide resolved
|
Codacy is just wrong here, by the way. |
|
Hello @iSazonov! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
🎉 Handy links: |
PR Summary
Typed return value for SessionStateInternal.GetFunctionTable.
IDictionary<string, FunctionInfo> instead of IDictionary.
PR Context
Removes unnecessary casts, and helps with later nullablility changes.
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.