[Mono-bugs] [Bug 32925][Maj] New - Casting to a pointer which isn't a standard type causes CS1002 error.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
28 Oct 2002 08:58:17 -0000
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 alan@alanz.com.
http://bugzilla.ximian.com/show_bug.cgi?id=32925
--- shadow/32925 Mon Oct 28 03:58:16 2002
+++ shadow/32925.tmp.19583 Mon Oct 28 03:58:17 2002
@@ -0,0 +1,74 @@
+Bug#: 32925
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: alan@alanz.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Casting to a pointer which isn't a standard type causes CS1002 error.
+
+Description of Problem:
+
+Mcs doesn't allow casting to a pointer which isn't a standard type of
+Mono. In my test code it is trying to cast to a LibTestStruct* and
+failing. Whereas it casts to an int* ok.
+
+
+Code to reproduce the problem:
+using System;
+
+namespace testapp{
+ public unsafe class LibTestAPI{
+
+ struct LibTestStruct{
+ void* pData;
+ void* pTest1;
+ }
+
+ public void Create(){
+ int* ptr_int = (int*) 7;
+ LibTestStruct* the_struct = (LibTestStruct*) 7;
+// CS1002 error
+ }
+ }
+
+ class TestApp{
+ [STAThread]
+ static void Main(string[] args){
+ LibTestAPI myapi = new LibTestAPI();
+ myapi.Create();
+ }
+ }
+}
+
+
+
+Actual Results:
+
+# mcs --unsafe testapp.cs
+syntax error, expecting BASE BOOL BYTE CHAR CHECKED DECIMAL DOUBLE FALSE
+FLOAT
+INT LONG NEW NULL OBJECT SBYTE SHORT SIZEOF STRING THIS TRUE TYPEOF UINT
+ULONG UNCHECKED USHORT VOID OPEN_PARENS TILDE PLUS MINUS BANG BITWISE_AND
+STAR OP_INC OP_DEC LITERAL_INTEGER LITERAL_FLOAT LITERAL_DOUBLE
+LITERAL_DECIMAL LITERAL_CHARACTER LITERAL_STRING IDENTIFIER
+testapp.cs(13) error CS1002: Expecting `;'
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+
+The code is valid and should compile ok, performing the cast.
+
+How often does this happen?
+
+Everytime