crayon icon indicating copy to clipboard operation
crayon copied to clipboard

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

Open blakeohare opened this issue 5 years ago • 1 comments

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 avatar May 28 '19 23:05 blakeohare

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

blakeohare avatar May 30 '19 23:05 blakeohare