Skip to content

Fix handling of imports involving synthetic case class objects#1231

Merged
lihaoyi merged 2 commits intocom-lihaoyi:masterfrom
lihaoyi:fix-474
Dec 2, 2021
Merged

Fix handling of imports involving synthetic case class objects#1231
lihaoyi merged 2 commits intocom-lihaoyi:masterfrom
lihaoyi:fix-474

Conversation

@lihaoyi
Copy link
Copy Markdown
Member

@lihaoyi lihaoyi commented Dec 2, 2021

Fixes #474

Turns out that even though the companion object for a case class Foo is marked as synthetic, it can still be imported and used. Thus when determining imports, we should not filter out synthetic symbols

Added tests including the original repro, as well as a minimized repro. Both tests fail on master, pass on this PR

Copy link
Copy Markdown
Collaborator

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

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

Apart from what's mentioned in the comments, LGTM!

Comment thread amm/repl/src/test/scala/ammonite/session/ImportTests.scala Outdated
Comment thread amm/repl/src/test/scala/ammonite/session/ImportTests.scala
@lihaoyi
Copy link
Copy Markdown
Member Author

lihaoyi commented Dec 2, 2021

@alexarchambault thanks for the pointers, test suite is green now

@lihaoyi lihaoyi merged commit 5f9cddf into com-lihaoyi:master Dec 2, 2021
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.

implicit def should override all previous definitions

2 participants