Permalink
Browse files

Allow struct inheritance at runtime

  • Loading branch information...
xoofx committed Sep 27, 2015
1 parent c65ac4f commit 6090527755b4ee63a59e476ec52b9e7abcb8dfbe
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/vm/methodtablebuilder.cpp
@@ -1506,7 +1506,7 @@ MethodTableBuilder::BuildMethodTableThrowing(
// the System.Enum MethodTable is unset, then we must be building System.Enum and
// so we don't mark it as a ValueType.
if(HasParent() &&
((g_pEnumClass != NULL && GetParentMethodTable() == g_pValueTypeClass) ||
((g_pEnumClass != NULL && (GetParentMethodTable() == g_pValueTypeClass || GetParentMethodTable()->IsValueType())) ||
GetParentMethodTable() == g_pEnumClass))
{
bmtProp->fIsValueClass = true;
@@ -13094,8 +13094,7 @@ ClassLoader::CreateTypeHandleForTypeDefThrowing(
// Value types and enums should be sealed - disable inheritting from them (we cannot require sealed
// flag because of AppCompat)
if (pParentMethodTable->IsSealed() ||
(pParentMethodTable == g_pArrayClass) ||
pParentMethodTable->IsValueType())
(pParentMethodTable == g_pArrayClass))
{
pAssembly->ThrowTypeLoadException(pInternalImport, cl, IDS_CLASSLOAD_SEALEDPARENT);
}

0 comments on commit 6090527

Please sign in to comment.