This project is read-only.

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

Topics: APIs
Nov 14, 2014 at 12:47 PM
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.
Nov 14, 2014 at 3: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 10: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.
Nov 19, 2014 at 5: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 2:03 AM
No, but you can hide them from intellisense. Types can be "hidden" in namespaces.