Skip to content

Stop emitting fields for inlined fields. #1890

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

Merged
merged 3 commits into from
Jan 10, 2017

Conversation

nicolasstucki
Copy link
Contributor

Also move final val inlining logic to Inline as mentioned in #1879.

ctx.scala2Mode (stay compatible with Scala2 for now) */
}
val sym = vdef.symbol
skipBlocks(vdef.rhs) match {
Copy link
Contributor

Choose a reason for hiding this comment

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

No that's not right. The right hand side can also be an Ident and a Select with ConstantType.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the right body is:

   val sym = vdef.symbol
   sym.info match {
      case info: ConstantType if isFinalInlinableVal(sym) => sym.flags |= Inline
      case _ =>
   }

@odersky
Copy link
Contributor

odersky commented Jan 10, 2017

Also, I think it's cleaner to revert the original commit(s) of #1879 and then add the new changes.

@nicolasstucki
Copy link
Contributor Author

Ok, I will revert the changes and clean up the history.

@nicolasstucki
Copy link
Contributor Author

Reverted 63d68bf and reimplemented cleanly.

@odersky
Copy link
Contributor

odersky commented Jan 10, 2017

LTTM 👍

@odersky odersky merged commit d62a2c9 into scala:master Jan 10, 2017
@allanrenucci allanrenucci deleted the remove-inlined-fields branch December 14, 2017 19:24
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.

2 participants