-
Notifications
You must be signed in to change notification settings - Fork 2
Enhance Signature in Quotes #151
Comments
The thing with this is that creating dotty internal representation of signature is actually a lossy operation, it's not cleanly reversible without a lot of exploratory branching, which is perhaps concerning to me, if we make it unambiguously reversible this would be possible. |
@bishabosha Thanks for the explanation. Is "reversible" meaning the conversion between the |
@changvvb So what I mean is that the To convert a semantic name back to a type you have to reverse engineer the path by looking up members from left to right. The paths have enough information to tell you when selecting a member of an object, but it is ambiguous if something is a member of a class or package, so there has to be exploration to find that. Maybe in practise it is unambiguous but the structure of the name itself doesn't seem to tell you that |
so it does seem illegal to have a class and package with the same name, so then perhaps a package acts like a class in this situation and so no exploration is required |
@bishabosha Great explanation! It sounds feasible to convert semantic names to a typed |
@bishabosha Do you know what's the point of |
Signature is an internal implementation detail of the compiler and the tasty format, we shouldn't expose any method on it. |
@smarter should it be exposed at all in |
No idea, internally we use it to select an overload, it might be useful for that in the reflection layer too. |
https://github.com/lampepfl/dotty/blob/master/library/src/scala/quoted/Quotes.scala#L3359
The
Signature
inQuotes
only exposesdef paramSigs: List[String | Int]
anddef resultSig: String
without any information of type. I thinkQuotes
needs a well typedSignature
for better reflection.The text was updated successfully, but these errors were encountered: