Browse Source

Extend type inference to allow ref return types.

pull/1596/head
Siegfried Pammer 6 years ago
parent
commit
860f9db950
  1. 8
      ICSharpCode.Decompiler/CSharp/Resolver/TypeInference.cs

8
ICSharpCode.Decompiler/CSharp/Resolver/TypeInference.cs

@ -640,7 +640,13 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -640,7 +640,13 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
MakeLowerBoundInference(NullableType.GetUnderlyingType(U), NullableType.GetUnderlyingType(V));
return;
}
// Handle by reference types:
ByReferenceType brU = U as ByReferenceType;
ByReferenceType brV = V as ByReferenceType;
if (brU != null && brV != null) {
MakeExactInference(brU.ElementType, brV.ElementType);
return;
}
// Handle array types:
ArrayType arrU = U as ArrayType;
ArrayType arrV = V as ArrayType;

Loading…
Cancel
Save