andry-tino / Rosetta

Toolset for migrating your codebase from C# to TypeScript
http://antino-enlad.cloudapp.net:8080/job/Rosetta/
GNU General Public License v3.0
24 stars 9 forks source link

Type ambiguity with System types #35

Open andry-tino opened 7 years ago

andry-tino commented 7 years ago

When translating, it is possible that the source code defines types with the same name as types in MsCoreLib.dll and includes both namespaces, thus generating a clash.

The source code might define an interface:

namespace MyNamespace {
  namespace MySubnamespace {
    public interface INotifyCompletion { }
  }
}

However we have that interface also in MsCoreLibe: System.Runtime.CompilerServices.INotifyCompletion.

Especially when using syntax transformation (which rearranges using directives), we might end up in this situation:

using System.Runtime.CompilerServices;
using MyNamespace.MySubnamespace;

public class MyClass {
  protected INotifyCompletion notifier; // Name clash
}

When processing notifier, the semantic model detects an ambiguity.

andry-tino commented 7 years ago

To verify, with the new system as per #41, this should not happen