Skip to content

Commit

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

0 comments on commit 6090527

Please sign in to comment.