dotnet/roslyn

Simplify logic for deconstruction variables in ExpressionVariableFinder

開放

#15,064 建立於 2016年11月7日

 (0 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-CompilersConcept-Design DebtFeature - Tupleshelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Per discussion in PR https://github.com/dotnet/roslyn/pull/14871

  • Maybe we don't need MakeOutVariable and MakeDeconstructionVariable, instead one may suffice, by looking up the syntax tree.
  • Maybe we don't need CollectVariablesFromDeconstruction in ExpressionVariableFinder, instead we just need a VisitVariableDesignation which looks up the syntax tree to determine if it is an out or a deconstruction variable.
  • Then maybe we can re-use ExpressionVariableFinder instead of ForEachLoopBinder.CollectLocalsFromDeconstruction.

貢獻者指南