Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/coreclr/vm/typedesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,12 @@ BOOL TypeVarTypeDesc::SatisfiesConstraints(SigTypeContext *pTypeContextOfConstra
{
// Static virtual methods need an extra check when an abstract type is used for instantiation
// to ensure that the implementation of the constraint is complete
if (!thElem.IsTypeDesc() &&
//
// Do not apply this check when the generic argument is exactly a generic variable, as those
// do not hold the correct detail for checking, and do not need to do so. This constraint rule
// is only applicable for generic arguments which have been specialized to some extent
if (!thArg.IsGenericVariable() &&
!thElem.IsTypeDesc() &&
thElem.AsMethodTable()->IsAbstract() &&
thConstraint.IsInterface() &&
thConstraint.AsMethodTable()->HasVirtualStaticMethods())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static void Main(string[] args)
break;

case CallerMethodScenario.GenericOverConstrainedType:
mdIndividualTestMethod.Name = $"{mdIndividualTestMethod.Name}<(class {CommonPrefix}IFaceGeneric`1<!!U>, {CommonPrefix}IFaceNonGeneric, class {CommonPrefix}IFaceCuriouslyRecurringGeneric`1<!!T>) T,U>";
mdIndividualTestMethod.Name = $"{mdIndividualTestMethod.Name}<({(interfaceTypeSansImplPrefix.Contains("`") ? "class " : "")}{CommonPrefix}{interfaceTypeSansImplPrefix}) T,U>";

expectedString = expectedString.Replace("!!0", $"{constrainedTypePrefix}{constrainedType}");
expectedString = expectedString.Replace(ImplPrefix, "");
Expand Down
Loading