diff --git a/src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs b/src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs index 78e358ff5408e19b6bd628a3c7cd5898bd4dd5e0..9147e12ed7b1919b91f6e235a7449471df4a244f 100644 --- a/src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs +++ b/src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs @@ -177,10 +177,10 @@ private IEnumerable GetTypesSimple(ExpressionSyntax expressio private IEnumerable InferTypeInArrowExpressionClause(ArrowExpressionClauseSyntax arrowClause) { var parentSymbol = SemanticModel.GetDeclaredSymbol(arrowClause.Parent, CancellationToken); - var symbolReturnType = GetSymbolReturnType(parentSymbol); + var parentMemberType = GetMemberType(parentSymbol); - return symbolReturnType != null - ? SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(symbolReturnType)) + return parentMemberType != null + ? SpecializedCollections.SingletonEnumerable(new TypeInferenceInfo(parentMemberType)) : SpecializedCollections.EmptyEnumerable(); } @@ -2186,16 +2186,6 @@ private IEnumerable GetCollectionElementType(INamedTypeSymbol return SpecializedCollections.EmptyEnumerable(); } - - private ITypeSymbol GetSymbolReturnType(ISymbol symbol) - { - switch (symbol) - { - case IPropertySymbol property: return property.Type; - case IMethodSymbol method: return method.ReturnType; - default: return null; - } - } } } }