for (int i = 0; i < list.Count; ++i)
{
((Type)list).publicField *= 2;
}
[.net] Strange C# rule?
This code gives me "The left-hand side of an assignment must be a variable, property or indexer"
What am I missing here?
Hmmm. Is (Type) really the type you're casting... meaning is this the exact code? If it is, there is no publicField property or member in the System.Type class to assign the value to. This could be your problem. Otherwise, if you have created a class that they Type represents and the publicField is really a public field, there might be another issue.
Well, that was simplification of what was going on, and when I wrote up that program it compiled. [sad]
I'll go see what is wrong here...
I'll go see what is wrong here...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement