Skip to content

Add back symbols to TASTy reflect #4976

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

No description provided.

@Blaisorblade
Copy link
Contributor

It's cool that exported symbols are compared by == not by eq (even though they're the same internally). Is there a way to forbid calling eq? Unless we're very confident this bit is safe to expose.

Another problem is that we still expose the internal details of desugaring of source definitions into definitions and symbols — objects create two symbols, case classes must create 1 for the class and two for the companion, etc.

Those details might be appropriate for tasty reflection since it shows the typer output (tho @olafurpg has spent time hiding many such things), but only as long as they're things you'd be comfortable spec'ing — because that's what you are essentially doing even if you don't write that spec down. Details about e.g. enum are more concerning.

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

@@ -2,4 +2,4 @@ package dotty.tools.dotc.tastyreflect

import dotty.tools.dotc.core._

Copy link
Contributor

Choose a reason for hiding this comment

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

Format the following line into several lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -2,4 +2,4 @@ package scala.tasty

import scala.tasty.reflect._

Copy link
Contributor

Choose a reason for hiding this comment

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

Reformat the following line to be shorter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

/** Tasty reflect symbol */
trait SymbolOps extends TastyCore {

trait SymbolasAPI {
Copy link
Contributor

Choose a reason for hiding this comment

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

SymbolasAPI -> SymbolsAPI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

def localContext(implicit ctx: Context): Context
def tree(implicit ctx: Context): Option[Definition]
}
implicit def SymbolasDeco(symbol: Symbol): SymbolasAPI
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@nicolasstucki nicolasstucki merged commit e612d55 into scala:master Aug 22, 2018
@allanrenucci allanrenucci deleted the add-symbols-to-tasty-reflect branch August 22, 2018 14:25
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