blakeohare / crayon

Crayon Programming Language
MIT License
111 stars 10 forks source link

Imported library names can easily collide with .NET things in other libraries when exported to C# #260

Open blakeohare opened 5 years ago

blakeohare commented 5 years ago

There are now Crayon libraries called DateTime and Environment. The FileIOCommon uses System.Environment and System.DateTime classes but does not use the "System."fully qualified name. This causes a compilation error if FileIO and DateTime are used in the same project that is exported to a single-solution C# project (runtime library loading is immune to this problem since they don't have visibility into each other)

This can be easily fixed by adding "System." but ideally, there'd be an extra layer of insurance against this. C#-based libraries could be wrapped with an extra namespace unique to that library such as Interpreter.Libraries.WrappedLib{name}.{name} instead of just Interpreter.Libraries.{name}. Not foolproof, but will stop 99.999% of cases.

blakeohare commented 5 years ago

Partially addressed by https://github.com/blakeohare/crayon/commit/de18e5955a750ff14a6bc0c33f1066fe2d8caf9b