Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed scaladoc failure on @throws tag when -implicits flag is on #9105

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Fixed scaladoc failure on @throws tag when -implicits flag is on #9105

merged 1 commit into from
Jul 13, 2020

Conversation

forketyfork
Copy link
Contributor

This fixes scala/bug#11021
The issue was due to incompatibility of the two features (one is parsing @hideImplicitConversion to filter out unwanted conversions, another is parsing @throws tag to add a link to a referenced exception).
The code that filters out the hidden implicit conversions tries to parse the comment in search for the @hideImplicitConversion tag. Previously this happened during ModelFactory.makeModel().
But if a comment contains a @throws tag, the code that parses this tag assumes the model is already finished (ModelFactory.modelFinished == true), since it needs to lookup the exception.
Solved by moving the @hideImplicitConversion filtering to the ModelFactory.completeModel() stage, after the model is already finished.

@scala-jenkins scala-jenkins added this to the 2.13.4 milestone Jul 8, 2020
@forketyfork
Copy link
Contributor Author

Signed the CLA.

@forketyfork forketyfork changed the title [bug#11021] Fixed scaladoc failure on @throws tag when -implicits flag is on Jul 8, 2020
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @forketyfork, welcome, and thank you for the fix!

One idea: did you try changing conversions to be a lazy val instead?

The issue was due to incompatibility of the two features (one is parsing @hideImplicitConversion to filter out unwanted conversions, another is parsing @throws tag to add a link to a referenced exception).
The code that filters out the hidden implicit conversions tries to parse the comment in search for the @hideImplicitConversion tag. Previously this happened during ModelFactory.makeModel().
But if a comment contains a @throws tag, the code that parses this tag assumes the model is already finished (ModelFactory.modelFinished == true), since it needs to lookup the exception.
Solved by moving the implicit handling to the ModelFactory.completeModel() stage, after the model is already finished.
@forketyfork
Copy link
Contributor Author

@lrytz thanks for the tip, I applied it. That's definitely a better way to fix the issue!

@lrytz lrytz merged commit daa51f5 into scala:2.13.x Jul 13, 2020
@SethTisue SethTisue added the tool:scaladoc Changes to ScalaDoc, the API documentation generator label Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool:scaladoc Changes to ScalaDoc, the API documentation generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scaladoc 2.12.6 crash on @throws with -implicits
4 participants