Skip to content

Conversation

@hamzaremmal
Copy link
Member

Closes #22498

override def transformDefDef(tree: DefDef)(using Context): DefDef = {
val sym = tree.symbol
tree.rhs match {
case _ if sym.isConstructor && sym.hasPublicInBinary =>
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a weird way to write an if condition, but avoids another level of indentation with an if-else expression.

Copy link
Contributor

Choose a reason for hiding this comment

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

SIP-39 - Uncluttering Abuse of Match

@hamzaremmal hamzaremmal changed the title @publicInBinary has effect on secondary constructors @publicInBinary has now effect on secondary constructors Feb 20, 2025
@hamzaremmal hamzaremmal force-pushed the i22497 branch 2 times, most recently from 6d84032 to b99156e Compare February 20, 2025 21:29
@hamzaremmal hamzaremmal merged commit 93ffd23 into scala:main Feb 21, 2025
28 checks passed
@hamzaremmal hamzaremmal deleted the i22497 branch February 21, 2025 13:50
@Gedochao Gedochao added stat:needs preview Features which may first be released under --preview stat:needs decision Some aspects of this issue need a decision from the maintainance team. labels Feb 24, 2025
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat:needs decision Some aspects of this issue need a decision from the maintainance team. stat:needs preview Features which may first be released under --preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@publicInBinary doesn't have any effect on secondary constructors

5 participants