Archived

This forum has been archived. Please start a new discussion on GitHub.

C# code generation issue

hi,

there is a little issue with the c# code generation.
Sample files are attached.

the generated code uses an int variable i for looping the sequence.
but i is also used as a slice parameter.

the generated code is not accepted by the c# compiler.
module Corsair
{
	class SomeClass
	{
		int a;
		int b;
	};
	sequence<SomeClass> SomeClassSeq;
	enum SomeEnum
	{A,B,C};
	interface SomeInterface
	{
		void Methode( SomeClassSeq ticks, string s, SomeEnum i  );
	};
};

workaround is to give the slice parameter a different name.

cu tom

PS: the same behaviour is for szx. this is also an internal used variable name.

Comments

  • Thanks for the bug report. I'll have a look at this and post a patch later today.

    Cheers,

    Michi.
  • I've posted a patch for CsUtil.cpp here.

    Rather silly of the compiler to complain about a same-named variable that is declared in a preceding nested scope, seeing that the scope at the point of the complaint is already closed and the variable no longer exists. After all, the whole point of scopes is to allow me to control the life time of variables and to create anonymous namespaces... :(

    Cheers,

    Michi.
  • A problem of Ice-Plugins for eclipse

    hi!
    I download a plug-in package today.but i find it dosen't supports eclipse3.1 finnal edition.Could you tell me it in which place can find it source code or an available edition?


    Thanks !
    MudfishCN