[Mono-bugs] [Bug 70749][Nor] New - CS0647: Error emitting 'PermissionSet' attribute for RequestOptional.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 22 Dec 2004 08:13:31 -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 sebastien@ximian.com.

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

--- shadow/70749	2004-12-22 08:13:31.000000000 -0500
+++ shadow/70749.tmp.29841	2004-12-22 08:13:31.000000000 -0500
@@ -0,0 +1,65 @@
+Bug#: 70749
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastien@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0647: Error emitting 'PermissionSet' attribute for RequestOptional.
+
+Description of Problem:
+
+MCS doesn't want to encode a PermissionSet attribute for
+SecurityAction.RequestOptional. The error message says it is not a valid
+action for a non-CAS permission, however PermissionSetAttribute inherits
+from CodeAccessSecurityAttribute (which inherits from SecurityAttribute) -
+so it is a CAS permission.
+
+
+Steps to reproduce the problem:
+1. Compile the following source code using MCS (HEAD)
+
+using System;
+using System.Reflection;
+using System.Security;
+using System.Security.Permissions;
+
+[assembly: PermissionSet (SecurityAction.RequestOptional, Unrestricted=true)]
+
+public class Program {
+
+	static public int Main (string[] args)
+	{
+		Console.WriteLine ("Hello");
+	}
+}
+
+
+Actual Results:
+poupou@pollux:~/src/bugzilla> mcs bug.cs
+bug.cs(6) error CS0647: Error emitting 'PermissionSet' attribute because
+'Invalid SecurityAction for non-Code Access Security permission'
+bug.cs(10) error CS0161: Not all code paths return a value
+Compilation failed: 2 error(s), 0 warnings
+
+
+Expected Results:
+Success
+
+
+How often does this happen? 
+Always.
+
+
+Additional Information:
+poupou@pollux:~/src/bugzilla> mcs --version
+Mono C# compiler version 1.1.3.0