[Scala3] Handle private Bundle parameters#5153
Conversation
| val paramSymss = record.symbol.primaryConstructor.paramSymss | ||
| .filterNot(_.exists(_.isType)) |
There was a problem hiding this comment.
What is the difference between paramSymss and termParamss? It also seems weird to be filtering that things aren't types
There was a problem hiding this comment.
Also up above we get the contructor with:
val template = record.rhs.asInstanceOf[tpd.Template]
val primaryConstructorOpt = Option(template.constr)
Should we keep that or just use record.symbol.primaryConstructor throughout?
There was a problem hiding this comment.
paramSymss is everything in a class constructor: type params, value params+types, implicit params. termParamss are ValDefs in the constructor. the filter just skips over the type params
There was a problem hiding this comment.
Also up above we get the contructor with:
iirc that's how it's done in the compiler
There was a problem hiding this comment.
i think this was it, not sure tho been a minute https://github.com/scala/scala3/blob/045f230af82c6d8c060164df154ca7933543e3ad/compiler/src/dotty/tools/dotc/transform/init/Semantic.scala#L816
This was a missing feature from the plugin where it would skip Bundles with inaccessible constructor parameters.
Contributor Checklist
docs/src?Type of Improvement
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
3.6.x,5.x, or6.xdepending on impact, API modification or big change:7.0)?Enable auto-merge (squash)and clean up the commit message.Create a merge commit.