You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectMyClass {
@mypackage.MyMacro.myAnnotation
classMyInnerClassdefmain(args: Array[String]):Unit= {
new the_class_name_is_modified_by_myAnnotation
}
}
new the_class_name_is_modified_by_myAnnotation should compile when -Ymacro-annotations is set. However, -Ymacro-annotations is ignored by scaladoc in Scala 2.13.0-M4, while the same macro annotation works when paradise plug-in is enabled in Scala 2.12.6.
git clone https://github.com/Atry/scaladoc-macro-annotations.git && cd scaladoc-macro-annotations && sbt +doc
Cloning into 'scaladoc-macro-annotations'...
remote: Counting objects: 16, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 16 (delta 0), reused 16 (delta 0), pack-reused 0
Unpacking objects: 100% (16/16), done.
[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt ...
[info] Loading global plugins from /Users/twer/.sbt/1.0/plugins
[info] Loading project definition from /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/project
[info] Updating ProjectRef(uri("file:/private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/project/"), "scaladoc-macro-annotations-build")...
[info] Done updating.
[info] Loading settings for project scaladoc-macro-annotations from build.sbt ...
[info] Set current project to scaladoc-macro-annotations (in build file:/private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/)
[info] Setting Scala version to 2.12.6 on 2 projects.
[info] Reapplying settings...
[info] Set current project to scaladoc-macro-annotations (in build file:/private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/)
[info] Updating macros...
[info] Done updating.
[info] Updating ...
[info] Main Scala API documentation to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/macros/target/scala-2.12/api...
[info] Done updating.
[info] Compiling 1 Scala source to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/macros/target/scala-2.12/classes ...
model contains 4 documentable templates
[warn] there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
[warn] one warning found
[info] Done compiling.
[info] Main Scala API documentation successful.
[info] Main Scala API documentation to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/target/scala-2.12/api...
model contains 4 documentable templates
[info] Main Scala API documentation successful.
[success] Total time: 3 s, completed Aug 15, 2018 12:41:49 AM
[info] Setting Scala version to 2.13.0-M4 on 2 projects.
[info] Reapplying settings...
[info] Set current project to scaladoc-macro-annotations (in build file:/private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/)
[info] Updating macros...
[info] Done updating.
[info] Updating ...
[info] Main Scala API documentation to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/macros/target/scala-2.13.0-M4/api...
[info] Done updating.
[info] Compiling 1 Scala source to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/macros/target/scala-2.13.0-M4/classes ...
model contains 4 documentable templates
[warn] there was one deprecation warning (since 2.11.0); re-run with -deprecation for details
[warn] one warning found
[info] Done compiling.
[info] Main Scala API documentation to /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/target/scala-2.13.0-M4/api...
[error] /private/tmp/scaladoc-macro-annotations/scaladoc-macro-annotations/src/main/scala/myapp/MyClass.scala:8:9: not found: type the_class_name_is_modified_by_myAnnotation
[error] new the_class_name_is_modified_by_myAnnotation
[error] ^
[info] No documentation generated with unsuccessful compiler run
[error] one error found
[info] Main Scala API documentation successful.
[error] (Compile / doc) Scaladoc generation failed
[error] Total time: 6 s, completed Aug 15, 2018 12:41:56 AM
The text was updated successfully, but these errors were encountered:
Atry
added a commit
to ThoughtWorksInc/Dsl.scala
that referenced
this issue
Aug 14, 2018
Given a macro annotation that renames any class to
the_class_name_is_modified_by_myAnnotation
and another project that use the annotation
new the_class_name_is_modified_by_myAnnotation
should compile when-Ymacro-annotations
is set. However,-Ymacro-annotations
is ignored by scaladoc in Scala 2.13.0-M4, while the same macro annotation works when paradise plug-in is enabled in Scala 2.12.6.The text was updated successfully, but these errors were encountered: