[Mono-bugs] [Bug 52156][Nor] New - cannot find SecurityPermissionAttribute
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 5 Jan 2004 09:41:22 -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 2004-01-05 09:41:22.000000000 -0500
+++ shadow/52156.tmp.3133 2004-01-05 09:41:22.000000000 -0500
@@ -0,0 +1,90 @@
+Bug#: 52156
+Product: Mono/Compilers
+Version: unspecified
+OS: other
+OS Details: Windows XP
+Status: REOPENED
+Resolution:
+Severity: Unknown
+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.
+
+------- Additional Comments From bmaurer@users.sf.net 2003-12-24 15:41 -------
+This seems to be working with cvs...
+
+------- Additional Comments From ginga@kit.hi-ho.ne.jp 2004-01-05 09:41 -------
+Curiously, this still occurs on cygwin.
+
+This can be easily checked by "make test" in class/corlib, using mcs
+instead of csc. (Be careful to run mcs on *mono* runtime, not on
+MS.NET runtime.)