https://bugzilla.novell.com/show_bug.cgi?id=440774
Summary: `int*[]' array initializer problem
Product: Mono: Compilers
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
When compiling the following test case:
======
using System;
namespace ConsoleApplication6
{
unsafe class Program
{
static int a;
static int* the_ptr = (int*) 0xdeadbeaf;
static int** the_pptr = (int**) 0xdeadbeaf;
static void Main(string[] args)
{
Console.WriteLine ("TEST: {0:x}", new IntPtr (the_pptr).ToInt64
());
fixed (int* a_ptr = &a)
{
Console.WriteLine(new IntPtr(a_ptr));
int*[] array = { the_ptr };
int*[] array2 = { a_ptr };
int* ptr = the_ptr;
int** pptr = the_pptr;
fixed (int** pptr2 = &the_ptr)
{
Console.WriteLine(new IntPtr(pptr));
}
}
}
}
}
======
I'm getting
======
[EMAIL PROTECTED]:debugger$ mcs -unsafe -debug
/work/mordor/ConsoleApplication6/ConsoleApplication6/Program.cs
/work/mordor/ConsoleApplication6/ConsoleApplication6/Program.cs(19,24): error
CS0029: Cannot implicitly convert type `int*' to `string'
/work/mordor/ConsoleApplication6/ConsoleApplication6/Program.cs(19,24): error
CS0029: Cannot implicitly convert type `string[]' to `int*[]'
/work/mordor/ConsoleApplication6/ConsoleApplication6/Program.cs(20,24): error
CS0622: Can only use array initializer expressions to assign to array types.
Try using a new expression instead
=======
This works fine with Visual Studio.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs