Skip to content

Commit ee21027

Browse files
Cater net 45 and non-compiling solutions
1 parent 18e8526 commit ee21027

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

CodeConverter/CSharp/BuiltInVisualBasicOperatorSubstitutions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ private static bool IsStringType(this ITypeSymbol @this)
472472

473473
private static bool IsObjectType(this ITypeSymbol @this)
474474
{
475-
return @this.SpecialType == SpecialType.System_Object;
475+
return @this?.SpecialType == SpecialType.System_Object;
476476
}
477477

478478
private static bool IsDecimalType(this ITypeSymbol @this)

CodeConverter/CSharp/CommonConversions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,5 +756,5 @@ public bool IsLinqDelegateExpression(VisualBasicSyntaxNode node)
756756
return false;
757757
}
758758

759-
private bool IsLinqDelegateExpression(ITypeSymbol convertedType) => System_Linq_Expressions_Expression_T.Equals(convertedType?.OriginalDefinition, SymbolEqualityComparer.Default);
759+
private bool IsLinqDelegateExpression(ITypeSymbol convertedType) => System_Linq_Expressions_Expression_T?.Equals(convertedType?.OriginalDefinition, SymbolEqualityComparer.Default) == true;
760760
}

CodeConverter/CSharp/MethodInfoExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ private static TDesiredFunc CreateOpenInstanceDelegateForcingType<TDesiredFunc>(
4242
public static MethodInfo ReflectedPropertyGetter<TInstance>(this TInstance instance,
4343
string propertyToAccess)
4444
{
45-
var propertyInfo = instance.GetType().GetProperty(propertyToAccess, BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
45+
var type = instance.GetType();
46+
var propertyInfo = type.GetProperty(propertyToAccess, BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
47+
propertyInfo ??= type.ReflectedType?.GetProperty(propertyToAccess, BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
4648
return propertyInfo?.GetMethod.GetRuntimeBaseDefinition();
4749
}
4850
}

0 commit comments

Comments
 (0)