[Mono-bugs] [Bug 52156][Nor] New - cannot find SecurityPermissionAttribute

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 14 Dec 2003 09:52:52 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ginga@kit.hi-ho.ne.jp.

http://bugzilla.ximian.com/show_bug.cgi?id=52156

--- shadow/52156	2003-12-14 09:52:52.000000000 -0500
+++ shadow/52156.tmp.18236	2003-12-14 09:52:52.000000000 -0500
@@ -0,0 +1,80 @@
+Bug#: 52156
+Product: Mono/Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ginga@kit.hi-ho.ne.jp               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: cannot find SecurityPermissionAttribute
+
+It is specific to SecuriryPermissionAttribute problem... mcs cannot find 
+this type.
+
+--------
+using System.Security.Permissions;
+
+class Test
+{
+//      [SecurityPermission (SecurityAction.PermitOnly)]
+        public void Foo ()
+        {
+                SecurityPermissionAttribute a = null;
+//              System.Xml.Serialization.XmlElementAttribute a = null;
+        }
+}
+
+You will also fail
+1) (commenting method body and) uncommenting attribute expression above
+2) using fully qualified type name
+
+You can successfully compile other attribute instantiation
+(e.g. XmlElementAttribute above)
+
+
+Actual Results:
+attribute.cs(10) error CS0246: Cannot find type 
+`SecurityPermissionAttribute'
+
+Expected Results:
+MS.NET compiles successfully.
+
+How often does this happen? 
+Always I try to use SecurityPermissionAttribute.
+
+Additional Information:
+
+1) There is "SecurityPermission" class inside System.Securiry.Permissions 
+namespace, which might be ambiguous for attribute use (but I found 
+attribute.cs does not have such problem). 
+
+2) This CS0246 error comes from decl.cs line 332 (DeclSpace.ResolveType 
+()). Expression's ResolveAsTypeTerminal (type_resolve_ec) returns null 
+value. I could not solve further error location.
+
+3) I created another simple testcase, but *mcs compiles fine*.
+
+using System;
+
+namespace MyNamespace {
+
+public class Test
+{
+        TestAttribute Attr;
+}
+
+public class TestAttribute : Attribute
+{
+}
+
+}
+
+4) nant-0.84rc1 build fails because of this problem.