diff options
author | Marek Safar <marek.safar@gmail.com> | 2015-07-14 00:14:43 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2015-07-14 00:14:43 +0300 |
commit | 9b0b4497fb4e0826632bab3f6875640504bcbde6 (patch) | |
tree | ab8614a637a0095fc5c3d8056f4e4b344a348c80 /mcs/ilasm | |
parent | 541a65ddd3f4b49c4d5bb6324bae63f0ed569115 (diff) |
[ilasm] Make only structs automatically sealed (partially reverts 541a65ddd3f4b49c4d5bb6324bae63f0ed569115)
Diffstat (limited to 'mcs/ilasm')
-rw-r--r-- | mcs/ilasm/codegen/TypeDef.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mcs/ilasm/codegen/TypeDef.cs b/mcs/ilasm/codegen/TypeDef.cs index d78fa168fb7..55fbfd12675 100644 --- a/mcs/ilasm/codegen/TypeDef.cs +++ b/mcs/ilasm/codegen/TypeDef.cs @@ -351,6 +351,12 @@ namespace Mono.ILASM { else if (IsEnumType (parent.PeapiClass.nameSpace, parent.PeapiClass.name)) is_enum_class = true; + if (!IsValueType (name_space, name) && !IsEnumType (name_space, name) && + is_value_class && !is_enum_class && (attr & PEAPI.TypeAttr.Sealed) == 0) { + + attr |= PEAPI.TypeAttr.Sealed; + } + if (outer != null) { if (!outer.IsDefined) outer.Define (code_gen); |