bugDotGNU Portable.NET - Bugs: bug #11417, incompatible types in assignment:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11417: incompatible types in assignment: no conversion from `System.String' to `char *'

Submitter:  James Michael DuPont <mdupont>
Submitted:  Tue 28 Dec 2004 05:13:38 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Fri 31 Dec 2004 01:07:25 PM UTC, comment #3: 

This error occurs when compiling mono mcs,
in ./class/corlib/System/String.cs
System/String.cs:1405: incompatible types in assignment: no conversion from `System.String' to `char *'
System/String.cs:1409: invalid operands to binary `+'
System/String.cs:763: incompatible types in assignment: no conversion from `System.String' to `char *'
System/String.cs:797: incompatible types in assignment: no conversion from `System.String' to `char *'

James Michael DuPont <mdupont>
Tue 28 Dec 2004 05:28:53 PM UTC, comment #2: 

class test
{
internal unsafe void ToLowerInvariant ()
{
string tmp = "fooo";
fixed (char* source = tmp); // problem, line 8
char* bar = tmp;
}
}

This produces the following error on MS:
test.cs(8,13): error CS0029: Cannot implicitly convert type 'string' to 'char*'

It appears to allow implicit conversions of some types (maybe just string) within the fixed initialization. It fails again when using it in the embedded staements of the fixed context.

Llewellyn Pritchard <leppie>
Group Member
Tue 28 Dec 2004 05:24:23 PM UTC, comment #1: 

I have tested this with the MS C# compiler, and it does indeed allow that implicit conversion, and its news to me!

Llewellyn Pritchard <leppie>
Group Member
Tue 28 Dec 2004 05:13:38 PM UTC, original submission:  

I dont know if this code is valid, but mono compiles it.
testcase1.cs:8: incompatible types in assignment: no conversion from `System.String' to `char *'

class test
{
[NonSerialized] private char start_char;
internal unsafe void ToLowerInvariant ()
{
string tmp;
fixed (char* source = tmp); // problem, line 8
}
}

James Michael DuPont <mdupont>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #12200:  turbo_encode.dev added by None (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2007-03-18 None Attached File- Added turbo_encode.dev, #12200

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code