Skip to content

Commit

Permalink
Fix outerloop CI error (dotnet#87789)
Browse files Browse the repository at this point in the history
* Fix issue where type validation checker failed to instantiate signature before performing signature comparison
  • Loading branch information
davidwrighton committed Jun 20, 2023
1 parent 6240d80 commit 0c77cbe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Task<bool> ValidateTypeWorkerHelper(TypeDesc typeToCheckForSkipValidation)
var methodDecl = type.EcmaModule.GetMethod(methodImpl.MethodDeclaration);

// Validate that all MethodImpls actually match signatures closely enough
if (!methodBody.Signature.EqualsWithCovariantReturnType(methodDecl.Signature))
if (!methodBody.Signature.ApplySubstitution(type.Instantiation).EqualsWithCovariantReturnType(methodDecl.Signature.ApplySubstitution(type.Instantiation)))
{
AddTypeValidationError(type, $"MethodImpl with Body '{methodBody}' and Decl '{methodDecl}' do not have matching signatures");
return false;
Expand Down Expand Up @@ -437,7 +437,7 @@ Task<bool> ValidateTypeWorkerHelper(TypeDesc typeToCheckForSkipValidation)
if ((virtualMethod.OwningType != type.BaseType) && (virtualMethod.OwningType != type) && (baseTypeVirtualMethodAlgorithm != null))
{
var implementationOnBaseType = baseTypeVirtualMethodAlgorithm.FindVirtualFunctionTargetMethodOnObjectType(virtualMethod, type.BaseType);
if (!implementationMethod.Signature.EqualsWithCovariantReturnType(implementationOnBaseType.Signature))
if (!implementationMethod.Signature.ApplySubstitution(type.Instantiation).EqualsWithCovariantReturnType(implementationOnBaseType.Signature.ApplySubstitution(type.Instantiation)))
{
AddTypeValidationError(type, $"Virtual method '{virtualMethod}' overriden by method '{implementationMethod}' does not satisfy the covariant return type introduced with '{implementationOnBaseType}'");
return false;
Expand Down

0 comments on commit 0c77cbe

Please sign in to comment.