Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created February 14, 2019 21:03
Show Gist options
  • Save controlflow/86c2437a5ad1128f7a3448466c115018 to your computer and use it in GitHub Desktop.
Save controlflow/86c2437a5ad1128f7a3448466c115018 to your computer and use it in GitHub Desktop.
var inferredType = currentStyle == VariableStyle.UseVar
? variableType
: deconstructionInfo.Indices.IsEmpty()
? deconstructionInfo.TopmostExpression.Type()
: FindInferredTypeForDeconstructionVariable(deconstructionInfo.TopmostExpression.GetExpressionType(),deconstructionInfo.Indices);
var inferredType = currentStyle switch {
VariableStyle.UseVar => variableType,
_ when deconstructionInfo.Indices.IsEmpty() => deconstructionInfo.TopmostExpression.Type(),
_ => FindInferredTypeForDeconstructionVariable(deconstructionInfo.TopmostExpression.GetExpressionType(),deconstructionInfo.Indices)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment