Skip to content

Remove old owner context from reflection API #10414

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
merged 1 commit into from
Nov 21, 2020

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Nov 20, 2020

This context does not carry any information.

@nicolasstucki nicolasstucki self-assigned this Nov 20, 2020
@nicolasstucki nicolasstucki force-pushed the remove-old-owner-context branch 2 times, most recently from 5b3e0f3 to eabb3c1 Compare November 20, 2020 16:11
@nicolasstucki nicolasstucki added this to the 3.0.0-RC1 milestone Nov 20, 2020
@nicolasstucki nicolasstucki force-pushed the remove-old-owner-context branch from eabb3c1 to 1f96b09 Compare November 20, 2020 18:17
@nicolasstucki nicolasstucki marked this pull request as ready for review November 20, 2020 20:13
@nicolasstucki nicolasstucki force-pushed the remove-old-owner-context branch from 1f96b09 to 89728ae Compare November 21, 2020 08:46
@nicolasstucki nicolasstucki force-pushed the remove-old-owner-context branch from 89728ae to a10a5f6 Compare November 21, 2020 12:36
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -66,7 +66,7 @@ trait SyntheticsSupport:
def hackGetAllMembers(using QuoteContext)(rsym: qctx.reflect.Symbol): List[qctx.reflect.Symbol] = {
import qctx.reflect._
import dotty.tools.dotc
given ctx as dotc.core.Contexts.Context = rootContext.asInstanceOf
given ctx as dotc.core.Contexts.Context = qctx.asInstanceOf[scala.quoted.runtime.impl.QuoteContextImpl].ctx
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why it needs the cast --- ideally APIs in scala.quote._ will be enough for usage, so that there is no need to use both reflect API and compiler API.

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 hacky method needs to be removed. Nobody should ever do this kind of cast.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is in the list of TODOs

@nicolasstucki nicolasstucki merged commit 305216a into scala:master Nov 21, 2020
@nicolasstucki nicolasstucki deleted the remove-old-owner-context branch November 21, 2020 13:44
@Kordyjan Kordyjan modified the milestones: 3.0.0-M3, 3.0.0 Aug 2, 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