Skip to content

Commit 05983e7

Browse files
authored
Merge pull request #1881 from Hosch250/Issue1853
Fix invalid cast
2 parents e772e8f + de40250 commit 05983e7

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

RetailCoder.VBE/Inspections/ParameterCanBeByValInspection.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,6 @@ public ParameterCanBeByValInspection(RubberduckParserState state)
1818
public override string Description { get { return InspectionsUI.ParameterCanBeByValInspectionName; } }
1919
public override CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }
2020

21-
// if we don't want to suggest passing non-primitive types ByRef (i.e. object types and Variant), then we need this:
22-
private static readonly string[] PrimitiveTypes =
23-
{
24-
Tokens.Boolean,
25-
Tokens.Byte,
26-
Tokens.Date,
27-
Tokens.Decimal,
28-
Tokens.Double,
29-
Tokens.Long,
30-
Tokens.LongLong,
31-
Tokens.LongPtr,
32-
Tokens.Integer,
33-
Tokens.Single,
34-
Tokens.String,
35-
Tokens.StrPtr
36-
};
37-
3821
public override IEnumerable<InspectionResultBase> GetInspectionResults()
3922
{
4023
var declarations = UserDeclarations.ToList();

RetailCoder.VBE/Inspections/VariableTypeNotDeclaredInspectionResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override void Fix()
5252

5353
if (string.IsNullOrEmpty(originalInstruction))
5454
{
55-
fix = DeclareExplicitVariant(Context.Parent as VBAParser.ConstSubStmtContext, out originalInstruction);
55+
fix = DeclareExplicitVariant(Context as VBAParser.ConstSubStmtContext, out originalInstruction);
5656
}
5757

5858
if (string.IsNullOrEmpty(originalInstruction))

0 commit comments

Comments
 (0)