nikhilk/scriptsharp — Issue #133: Compiler - Variable and function name in conflict
Author: jimmygilles
Created: 2011-12-16 21:44:42+00:00
State: open

Hello,

I found a little bug with the compiler.

This C# code

```c#
using System;
namespace Demo
{
public class Class1
{
private Int32 _myFunction;

private void MyFunction()
{
}
}
}
```

is converted to (in debug) :

```javascript
(function() {

Type.registerNamespace('Demo');

Demo.Class1 = function Demo_Class1() {
}

Demo.Class1.prototype = {
_myFunction: 0,

_myFunction: function Demo_Class1$_myFunction() {
}
}

Demo.Class1.registerClass('Demo.Class1');
})();
```

As you can see, the private variable and the private function are using the same javascript name (_myFunction).

Thank you.