We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83a8e3b commit 9aeb238Copy full SHA for 9aeb238
csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ImplicitCast.cs
@@ -42,13 +42,12 @@ private void AddOperatorCall(IMethodSymbol method)
42
private static IMethodSymbol? GetImplicitConversionMethod(ITypeSymbol type, object value) =>
43
type
44
.GetMembers()
45
- .Where(m =>
46
- m is IMethodSymbol method &&
+ .OfType<IMethodSymbol>()
+ .Where(method =>
47
method.GetName() == "op_Implicit" &&
48
method.Parameters.Length == 1 &&
49
method.Parameters[0].Type.Name == value.GetType().Name
50
)
51
- .Cast<IMethodSymbol>()
52
.FirstOrDefault();
53
54
// Creates a new generated expression with an implicit cast added, if needed.
0 commit comments