Stop using InternalsVisibleTo to from the core compiler to C# and VB compiler

Topics: APIs
Nov 14, 2014 at 11:47 AM
Currently, the Core compiler has a lot of internal types that are used by the C# and the VB compiler thanks to InternalsVisibleTo. This prevents other from building no the Core compiler and creating their own compilers that creates Compilations that can be used with the other compilers.

Now that Roslyn is open source, I don't think there is a point in trying to limit what people can built on top of it, and how they can incorporate it into their own compilers/projects. Now I'm not saying that every type should be public, but removing InternalsVisibleTo pointing at the C# and the VB compiler would show what types would have to be public in order to build on top of it. The tests, of cause, would still use InternalsVisibleTo.
Developer
Nov 14, 2014 at 2:49 PM
Unfortunately that would make the Roslyn public API hard to use, as there would be hundreds of "public" types and methods that would be dangerous or incorrect to use for clients of the C# and VB compilers.
Nov 18, 2014 at 9:08 AM
This should just be solved by "hiding" away said types in namespaces most people don't touch. There are probably already millions of APIs in the .NET runtime that most people don't use. You could even make them hidden from intellisense if you wanted. But the fact that I have to fork Roslyn to build on it is really limiting.
Developer
Nov 19, 2014 at 4:32 PM
You cannot have some methods of a class be in one namespace and other methods of the class be in another namespace.
Nov 23, 2014 at 1:03 AM
No, but you can hide them from intellisense. Types can be "hidden" in namespaces.