A common pitfall I've noticed is when people try to use a non-shared data type with external. This usually happens when they try to use list instead of array or a variant when they're trying to use a union type. Would it be possible for the compiler to check if any types in an external aren't on the shared data type list and emit a warning if they aren't?
I imagine this would make BuckleScript more beginner friendly, since type errors with externals are frustrating to debug. However, one possible downside I can imagine is how well the compiler can handle abstract types, especially since abstract types can be very useful with externals.
A common pitfall I've noticed is when people try to use a non-shared data type with
external
. This usually happens when they try to uselist
instead ofarray
or a variant when they're trying to use a union type. Would it be possible for the compiler to check if any types in an external aren't on the shared data type list and emit a warning if they aren't?I imagine this would make BuckleScript more beginner friendly, since type errors with externals are frustrating to debug. However, one possible downside I can imagine is how well the compiler can handle abstract types, especially since abstract types can be very useful with externals.