Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/ilasm
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2015-07-14 00:14:43 +0300
committerMarek Safar <marek.safar@gmail.com>2015-07-14 00:14:43 +0300
commit9b0b4497fb4e0826632bab3f6875640504bcbde6 (patch)
treeab8614a637a0095fc5c3d8056f4e4b344a348c80 /mcs/ilasm
parent541a65ddd3f4b49c4d5bb6324bae63f0ed569115 (diff)
[ilasm] Make only structs automatically sealed (partially reverts 541a65ddd3f4b49c4d5bb6324bae63f0ed569115)
Diffstat (limited to 'mcs/ilasm')
-rw-r--r--mcs/ilasm/codegen/TypeDef.cs6
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);