Skip to content

Commit 8428eb4

Browse files
committed
inspection fix (#1696)
* added AsTypeName to the context-sensitive commandbar * clear built-in references at every resolution; fixed issue with null parse trees, given built-in modules get a module state instance. * fixed OverflowException in GetTypeName; built-in parameters now have return type info :) * returning built-in members now have return type info as well * removed hard-coded defaults in ClassModuleDeclaration * added IsBadReadPtr check in COM declarations collector * Implemented CanExecute in Project Explorer rename command * cleaned up FormDesignerRefactorRename command * fixed IOExceptions in QualifiedModuleName * use filename, not buildfilename * GetDisplayName being the part in parens, should be null when not applicable; made it private * renamed namespace Rubberduck.UI.CodeInspections to Rubberduck.UI.Inspections for consistency with Rubberduck.Inspections namespace * changed background color of bottom panel in CodeExplorer and InspectionResults toolwindows * fixed broken keybinding "Esc" -> "Escape" * added copy/export button to SearchView (todo: implement ExecuteCopyResultsCommand) * Revert "added copy/export button to SearchView (todo: implement ExecuteCopyResultsCommand)" This reverts commit e9946b7. * assert ProjectId isn't null * fixes #1664 * some French translations * fixed possible NRE's in QualifiedModuleName * fixes #1671 * changed wording of fr resources for settings dialog (left pane items) * fixes #1672 * more French translations * fix RuntimeBinderException with optional object parameters (resolver bug) * fixed AsTypeName of optional parameters with a default value * fixed "resolving" state in the status bar * fixed FunctionReturnValueNotUsed firing on Sub procedures
1 parent e1a3e8a commit 8428eb4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

RetailCoder.VBE/Inspections/FunctionReturnValueNotUsedInspection.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
3232
var nonInterfaceFunctions = functions.Except(interfaceMembers.Union(interfaceImplementationMembers));
3333
var nonInterfaceIssues = GetNonInterfaceIssues(nonInterfaceFunctions);
3434
return interfaceMemberIssues.Union(nonInterfaceIssues);
35-
//// Temporarily disabled until fix for lack of context because of new resolver is found...
36-
//return new List<InspectionResultBase>();
3735
}
3836

3937
private IEnumerable<FunctionReturnValueNotUsedInspectionResult> GetInterfaceMemberIssues(IEnumerable<Declaration> interfaceMembers)
4038
{
4139
return from interfaceMember in interfaceMembers
4240
let implementationMembers =
4341
UserDeclarations.FindInterfaceImplementationMembers(interfaceMember.IdentifierName).ToList()
44-
where
42+
where interfaceMember.DeclarationType == DeclarationType.Function &&
4543
!IsReturnValueUsed(interfaceMember) &&
4644
implementationMembers.All(member => !IsReturnValueUsed(member))
4745
let implementationMemberIssues =
@@ -58,7 +56,7 @@ private IEnumerable<FunctionReturnValueNotUsedInspectionResult> GetInterfaceMemb
5856

5957
private IEnumerable<FunctionReturnValueNotUsedInspectionResult> GetNonInterfaceIssues(IEnumerable<Declaration> nonInterfaceFunctions)
6058
{
61-
var returnValueNotUsedFunctions = nonInterfaceFunctions.Where(function => !IsReturnValueUsed(function));
59+
var returnValueNotUsedFunctions = nonInterfaceFunctions.Where(function => function.DeclarationType == DeclarationType.Function && !IsReturnValueUsed(function));
6260
var nonInterfaceIssues = returnValueNotUsedFunctions
6361
.Select(function =>
6462
new FunctionReturnValueNotUsedInspectionResult(

0 commit comments

Comments
 (0)