Support vals in @Id
annotations when compiled under scaladoc
#1306
Labels
Projects
Milestone
@Id
annotations when compiled under scaladoc
#1306
Issue described in https://t.me/izumi_ru/3971
BadIdAnnotation
is thrown in scaladoc mode during compilation with the following construct:This happens because normally
@Id(X)
would be expanded to@Id("x")
before the macro is called, however, this does not happen in scaladoc mode, because scaladoc erases literal singleton types for the purpose of showing widenedString
type in the documentation, this causesX
to not be inlined. (this was already discussed in this tracker before somewhere and this was the response to the bug in the scala tracker)We should somehow detect that we're running under scaladoc in
FunctoidMacro
and NOT throw the error in that case. We may possibly be able to detect it by checking for empty positions inc.enclosingPosition
/ or.pos
methods on trees – normal mode always has good positions, but scaladoc mode often has empty broken positions – but there may be better ways to detect scaladoc too.The text was updated successfully, but these errors were encountered: