Skip to content

Scala 2.12.3 -Xcheckinit crash with Lift 3.1.0 #10437

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

Closed
japgolly opened this issue Jul 28, 2017 · 7 comments
Closed

Scala 2.12.3 -Xcheckinit crash with Lift 3.1.0 #10437

japgolly opened this issue Jul 28, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@japgolly
Copy link

  1. Add Lift 3.1.0 libraryDependencies += "net.liftweb" %% "lift-webkit" % "3.1.0"
  2. scalacOptions += "-Xcheckinit"
  3. Run the following:
  import net.liftweb.common.Full
  import net.liftweb.http.{CometCreationInfo, MessageCometActor}

  final class OhNoes extends MessageCometActor {
    def die() = initCometActor(CometCreationInfo("", Full(""), <br/>, Map.empty, null))
  }

  new OhNoes().die()

With Scala 2.12.2 it runs fine; on 2.12.3 it throws an UninitializedFieldError about Lift's CometActor #564.

Stack trace excerpt:

scala.UninitializedFieldError: Uninitialized field: Example.scala: 4
	at OhNoes.net$liftweb$http$BaseCometActor$$_defaultHtml(Example.scala:4)
	at net.liftweb.http.BaseCometActor.defaultHtml(CometActor.scala:564)
	at net.liftweb.http.BaseCometActor.defaultHtml$(CometActor.scala:564)
	at OhNoes.defaultHtml(Example.scala:4)
	at net.liftweb.http.BaseCometActor.initCometActor(CometActor.scala:609)
	at net.liftweb.http.BaseCometActor.initCometActor$(CometActor.scala:607)
	at OhNoes.initCometActor(Example.scala:4)
	at OhNoes.die(Example.scala:5)
@timothyklim
Copy link

And akka too

@farmdawgnation
Copy link

Hi there, a friendly Lift committer here.

Please let us know if there's a change we could make to ensure the community build catches this regression. =)

@m4dc4p
Copy link

m4dc4p commented Jul 28, 2017

See smaller test case in #10439.

lrytz added a commit to lrytz/scala that referenced this issue Aug 4, 2017
Fields initialized with `_` are excluded from initialization
checks under `-Xcheckinit`.

Since 5f86b1d, the compiler checks that flag on the field symbol
instead of the getter. Unfortunately the flag was not actually copied
to the field symbol, causing the init check to be added.

Fixes scala/bug#10439, scala/bug#10437.
@lrytz
Copy link
Member

lrytz commented Aug 4, 2017

scala/scala#6024

@lrytz lrytz added the has PR label Aug 4, 2017
@lrytz lrytz self-assigned this Aug 4, 2017
@lrytz lrytz added this to the 2.12.4 milestone Aug 4, 2017
@SethTisue
Copy link
Member

Please let us know if there's a change we could make to ensure the community build catches this regression. =)

see scala/community-build#582

lrytz added a commit to lrytz/scala that referenced this issue Aug 4, 2017
Fields initialized with `_` are excluded from initialization
checks under `-Xcheckinit`.

Since 5f86b1d, the compiler checks that flag on the field symbol
instead of the getter. Unfortunately the flag was not actually copied
to the field symbol, causing the init check to be added.

Fixes scala/bug#10439 and it also fixes scala/bug#10437.
@steinybot
Copy link

I'm still seeing the same issue that was reported in akka/akka#23453 with Scala 2.12.4

@SethTisue
Copy link
Member

@steinybot please open a new ticket with reproduction details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants