From: Martin Baulig Date: Wed, 26 Jan 2005 08:47:32 +0000 (-0000) Subject: 2005-01-26 Martin Baulig X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=10cb6579aaac6b4704cc0ad324dc4fcefbb085a9;hp=4bb782ad0fa7af92debabc81f4ffdcf573bff892;p=mono.git 2005-01-26 Martin Baulig * class.cs (TypeContainer.AttributeTargets): Return the correct AttributeTargets depending on our `Kind' instead of throwing an exception; fixes #71632. svn path=/trunk/mcs/; revision=39562 --- diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 352abbcd51e..9f13da3d53d 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,9 @@ +2005-01-26 Martin Baulig + + * class.cs (TypeContainer.AttributeTargets): Return the correct + AttributeTargets depending on our `Kind' instead of throwing an + exception; fixes #71632. + 2005-01-26 Marek Safar Fix #71257 diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index d506eabbff3..a1743872a6d 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -713,7 +713,16 @@ namespace Mono.CSharp { public override AttributeTargets AttributeTargets { get { - throw new NotSupportedException (); + switch (Kind) { + case Kind.Class: + return AttributeTargets.Class; + case Kind.Struct: + return AttributeTargets.Struct; + case Kind.Interface: + return AttributeTargets.Interface; + default: + throw new NotSupportedException (); + } } } @@ -2794,12 +2803,6 @@ namespace Mono.CSharp { } } - public override AttributeTargets AttributeTargets { - get { - return AttributeTargets.Class; - } - } - public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb) { if (a.UsageAttribute != null) { @@ -2874,12 +2877,6 @@ namespace Mono.CSharp { this.ModFlags |= Modifiers.SEALED; } - public override AttributeTargets AttributeTargets { - get { - return AttributeTargets.Struct; - } - } - public const TypeAttributes DefaultTypeAttributes = TypeAttributes.SequentialLayout | TypeAttributes.Sealed | @@ -2936,12 +2933,6 @@ namespace Mono.CSharp { return null; } - public override AttributeTargets AttributeTargets { - get { - return AttributeTargets.Interface; - } - } - public const TypeAttributes DefaultTypeAttributes = TypeAttributes.AutoLayout | TypeAttributes.Abstract |