Symbols representing library names starting with _ cannot be created. #16445
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-not-planned
Closed as we don't intend to take action on the reported issue
library-mirrors
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Symbols represent source names.
The "dotted identifers" symbols appear to represent library names, so
#a.b.c
is the symbol corresponding to the library declarationlibrary a.b.c;
.(They can also be used to represent constructor names, like
#Foo.bar
, but I believe that use is being phased out, and the (simple) name of the constructor will only be#bar
).The problem is that a library name may start with
_
, but it is not at all obvious what that means wrt. privacy.If it means the name is "private" (i.e., not equal to the same sequence of characters in another library), then you can't give a warning if the library source is imported more than once (it will be different libraries), or if two libraries have the name
_a
, and they may even import the same part file. That sounds like unintended consequences that might be abused.On the other hand, if
_a
is not considered private as a library name, then the symbol#_a
will not match it, because the symbol is private.Also, there is no way to create a symbol for that library - all attempts to do so will create a private symbol instead. And we probably don't want to have
_a
as a non-private symbol too, that will be too confusing.My suggestion is to disallow library names starting with
_
.That may be a breaking change.
Alternatively, let them exist, but then we need to know what the library mirror of the library will return as the name,.
The text was updated successfully, but these errors were encountered: