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

consume inits part of package object within the inner scope #16282

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

somdoron
Copy link
Contributor

@somdoron somdoron commented Jul 23, 2022

package objects inits (the constructor + any extends)` should be in the scope of the package object vs other scala templates (class, object) that are in the package scope.

This PR fixes that, by calling the apply on the inits within the package object scope.

fixes #16259

@somdoron somdoron added the category:bugfix Bug fixes for released features label Jul 23, 2022
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Woohoo! Thank you!

Comment on lines +218 to +221
// TODO: should object already be recursive?
// an object is recursive if extends another type because we cannot figure out the provided types
// in the parents, we just mark the object as recursive (which is indicated by non-empty inits)
val recursive = !templ.inits.isEmpty
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll wait for Stu to comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this piece of code is actually a copy from the Defn.Object, so not really new.

@stuhood stuhood requested a review from tdyas July 26, 2022 15:21
@stuhood stuhood merged commit 7371aa4 into pantsbuild:main Jul 26, 2022
@stuhood stuhood added this to the 2.13.x milestone Jul 26, 2022
stuhood pushed a commit to stuhood/pants that referenced this pull request Aug 2, 2022
…ld#16282)

package objects `inits` (the constructor + any extends)` should be in the scope of the package object vs other scala templates (class, object) that are in the package scope.

This PR fixes that, by calling the apply on the inits within the package object scope.

Fixes pantsbuild#16259
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
stuhood pushed a commit to stuhood/pants that referenced this pull request Aug 2, 2022
…ld#16282)

package objects `inits` (the constructor + any extends)` should be in the scope of the package object vs other scala templates (class, object) that are in the package scope.

This PR fixes that, by calling the apply on the inits within the package object scope.

Fixes pantsbuild#16259
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Aug 2, 2022
…ick of #16282) (#16371)

package objects `inits` (the constructor + any extends)` should be in the scope of the package object vs other scala templates (class, object) that are in the package scope.

This PR fixes that, by calling the apply on the inits within the package object scope.

fixes #16259

[ci skip-rust]
[ci skip-build-wheels]

Co-authored-by: Doron Somech <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scala dependency inference fails with package objects
3 participants