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:
authorRodrigo Kumpera <kumpera@gmail.com>2016-03-04 09:40:33 +0300
committerRodrigo Kumpera <kumpera@gmail.com>2016-07-02 03:08:28 +0300
commit90e7004a63fb88070f93361a4da6b6e1fd940e6e (patch)
tree401370ea790beb92e80571962693366ea22284bc /mcs/ilasm
parent281fc599e307d506d1673ab2b0c10a3a4089a3df (diff)
[ilasm] Side with parent declaration when deciding if a type is an enum or a value type.
The conflict happens when a type is declared like this: .class value private auto ansi serializable sealed foo extends [mscorlib]System.Enum The value keyword would make it a value type and ignore the parent declaration. .net ilasm favors the later, which makes more sense.
Diffstat (limited to 'mcs/ilasm')
-rw-r--r--mcs/ilasm/codegen/TypeDef.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/ilasm/codegen/TypeDef.cs b/mcs/ilasm/codegen/TypeDef.cs
index 793e47c8a2a..74200cddf49 100644
--- a/mcs/ilasm/codegen/TypeDef.cs
+++ b/mcs/ilasm/codegen/TypeDef.cs
@@ -348,8 +348,10 @@ namespace Mono.ILASM {
if (IsValueType (parent.PeapiClass.nameSpace, parent.PeapiClass.name))
is_value_class = true;
- else if (IsEnumType (parent.PeapiClass.nameSpace, parent.PeapiClass.name))
+ else if (IsEnumType (parent.PeapiClass.nameSpace, parent.PeapiClass.name)) {
is_enum_class = true;
+ is_value_class = false;
+ }
if (!IsValueType (name_space, name) && !IsEnumType (name_space, name) &&
is_value_class && (attr & PEAPI.TypeAttr.Sealed) == 0) {