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

 
 

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

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

Submitted by:  James Michael DuPont <mdupont>
Submitted on:  Tue Dec 28 17:13:38 2004  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Fri Dec 31 13:07:25 2004, 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 Dec 28 17:28:53 2004, 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>
Project Member
Tue Dec 28 17:24:23 2004, 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>
Project Member
Tue Dec 28 17:13:38 2004, 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>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Sun Mar 18 11:40:40 2007NoneAttached File-=>Added turbo_encode.dev, #12200

Back to the top


Powered by Savane 3.1-cleanup