Skip to content

Changing the way how "companion class <-> companion" object links work #353

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

Closed
DarkDimius opened this issue Feb 9, 2015 · 1 comment
Closed

Comments

@DarkDimius
Copy link
Contributor

Idea is to give every class that has a companion a method $companionObject that has term ref to a companion object as a return type. Every object that has a companion class will get a $companionClass method with a return type that indicates a class.

I'm not sure if those methods should be generated in bytecode, but $companionObject could have valid uses in runtime.

Note that it's not obvious how to generate those methods. Eg: generation $companionObject method is simple only if the returning value is static. Otherwise the object and the class instance could have different lifetime and this means that non-static classes would require a field to support this.

@DarkDimius DarkDimius changed the title Changing the way how companion class <-> companion object Changing the way how \"companion class <-> companion\" object links work Feb 9, 2015
@DarkDimius DarkDimius changed the title Changing the way how \"companion class <-> companion\" object links work Changing the way how "companion class <-> companion" object links work Feb 9, 2015
DarkDimius added a commit to dotty-staging/dotty that referenced this issue Mar 26, 2015
@smarter
Copy link
Member

smarter commented Nov 18, 2015

Fixed by #436.

@smarter smarter closed this as completed Nov 18, 2015
tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 29, 2025
Backport "Fix scala#22724: Revert the PolyType case in scala#21744" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants