I have posted a stackoverflow question on this:
https://stackoverflow.com/questions/66837880/how-to-get-the-name-of-a-class-as-a-string-literal-at-compile-time-using-shapele
According to Prof. @DmytroMitin, it appears that a whitebox macro is the only option, fortunately it is not too complex, in dotty it may be introduced as a compiletime ops later
This feature, combining with RequireMsg[.] type, can be used to throw a customised ops error at compile-time, using a string interpolated with custom user type (https://twitter.com/soronpo/status/1275014596034809856). Similar to how @implicitNotFound error message is interpolated in native scala:
@implicitNotFound(msg = "Cannot prove that ${From} =:= ${To}.")
sealed abstract class =:=[From, To] extends (From <:< To) with Serializable {
...
}
Do you think this will be useful? I can submit a PR shortly but I may need some guidance to circumvent the NonLiteral constraint