Skip to content

Add missing parents to companions of case classes in stdlib-bootstrapped #18153

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

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Jul 6, 2023

No description provided.

@nicolasstucki nicolasstucki force-pushed the add-missing-AbstractFunction1-partents branch 5 times, most recently from aae006f to 3f0d899 Compare July 10, 2023 07:28
@nicolasstucki nicolasstucki marked this pull request as ready for review July 10, 2023 12:32
@nicolasstucki nicolasstucki requested a review from sjrd July 10, 2023 15:32
@SethTisue SethTisue changed the title Add missing parents to companions of case classes in stdlib-bootsrapped Add missing parents to companions of case classes in stdlib-bootstrapped Jul 11, 2023
else tp
case _ => tp

private def argTypeOfCaseClassThatNeedsAbstractFunction1(sym: Symbol)(using Context): Option[List[Type]] =
Copy link
Member

Choose a reason for hiding this comment

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

Why only those with 1 argument? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(TASTy) MiMa did not find cases with 2 or more arguments in the Scala 2 library.

&& !companionClass.primaryConstructor.is(Private)
&& !companionClass.primaryConstructor.info.isVarArgsMethod
then
sym.info.decl(nme.apply).info match
Copy link
Member

Choose a reason for hiding this comment

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

What if it is overloaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of the cases in the library are overloaded. This would need to be disambiguated if a new apply method is added to those objects.

@sjrd
Copy link
Member

sjrd commented Jul 19, 2023

Needs a rebase.

@nicolasstucki nicolasstucki force-pushed the add-missing-AbstractFunction1-partents branch from 3f0d899 to e0070d4 Compare July 20, 2023 07:52
@sjrd sjrd enabled auto-merge July 20, 2023 08:02
@sjrd sjrd merged commit aac8ba7 into scala:main Jul 20, 2023
@sjrd sjrd deleted the add-missing-AbstractFunction1-partents branch July 20, 2023 09:31
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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.

3 participants