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

Don't fail for deprecated lazy vals, fixes #85. #113

Closed
wants to merge 1 commit into from

Conversation

jrudolph
Copy link
Contributor

This somewhat fixes #85 so that genjavadoc does at least not fail. However,
like in the case for deprecated lazy vals with preexisting scaladoc, the
preexisting comment might be lost under some Scala versions.

The reason seems to be that starting from Scala 2.12 positions are reported
in a way that puts the original position on the private $lzycompute method
instead of on the accessor. To fix that additional considerations are necessary
to somehow reconcile position information from the lzycompute with the actual
accessor so that existing and generated scaladoc can be merged.

This somewhat fixes lightbend#85 so that genjavadoc does at least not fail. However,
like in the case for deprecated lazy vals with preexisting scaladoc, the
preexisting comment might be lost under some Scala versions.

The reason seems to be that starting from Scala 2.12 positions are reported
in a way that puts the original position on the private `$lzycompute` method
instead of on the accessor. To fix that additional considerations are necessary
to somehow reconcile position information from the lzycompute with the actual
accessor so that existing and generated scaladoc can be merged.
@jrudolph
Copy link
Contributor Author

I filed the remaining issue with lazy vals under #114. I still think this is at least an incremental improvement over failing hard like before.

@raboof
Copy link
Contributor

raboof commented Sep 18, 2017

Looks like the private void oldLazyVal$lzycompute () { throw new RuntimeException(); } doesn't show up on scala 2.10 and 2.11, but does for 2.12..

@raboof
Copy link
Contributor

raboof commented Sep 20, 2017

(we ended up working around this problem by replacing the lazy val with a def and a val, akka/akka@3307b35)

@ennru
Copy link
Member

ennru commented Oct 2, 2018

Is this still something that needs to be fixed?

@jrudolph
Copy link
Contributor Author

jrudolph commented Oct 2, 2018

I haven't seen it for a while but the problem might still be there.

The fix here only works under very specific circumstances so maybe we can just close the PR for now and reinvestigate if it should be necessary.

@jrudolph jrudolph closed this Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single-line ScalaDoc plus deprecated annotation would trigger a bug
3 participants