Skip to content
Draft
Changes from 1 commit
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
Prev Previous commit
handle vararg menthods that are not MethodReturnKind::NormalMethod
  • Loading branch information
VSadov committed Dec 13, 2025
commit 835bb64d9d43878097bc54e68e122b7897cc07a0
17 changes: 17 additions & 0 deletions src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,23 @@ MethodTableBuilder::EnumerateClassMethods()
}
}

// Vararg methods are not allowed to be marked MethodImpl.Async
// and even when they return Tasks they are still treated as NormalMethod.
if (returnKind != MethodReturnKind::NormalMethod)
{
if (MetaSig::IsVarArg(Signature(pMemberSignature, cMemberSignature)))
{
if (IsMiAsync(dwImplFlags))
{
BuildMethodTableThrowException(IDS_EE_VARARG_NOT_SUPPORTED);
}
else
{
returnKind = MethodReturnKind::NormalMethod;
}
}
}

//
// Create a new bmtMDMethod representing this method and add it to the
// declared method list.
Expand Down
Loading