Skip to content

Add Reflection Symbol docs #9983

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
Oct 12, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

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

@@ -2679,14 +2679,30 @@ trait Reflection { reflection =>
/** Annotations attached to this symbol */
def annots: List[Term]

/** Does this symbol come from a currently compiled source file? */
def isDefinedInCurrentRun: Boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be potentially ambiguous, as now the compiler may compile a batch of files in multiple runs to support macros.

def isDefinedInCurrentRun: Boolean

/** Dummy val symbol that owns all statements within the initialization of the class.
* This may also contain local definitions such as classes defined in a `locally` block in the class.
*/
def isLocalDummy: Boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding isLocalDummy and isRefinementClass, it would be better to not provide them if they are not useful in practice, as they involve implementation details that might change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should see if we can have an alternative design. We cannot return the owner of the local dummy as that would be ambiguous.

@nicolasstucki nicolasstucki merged commit 2f5b5fd into scala:master Oct 12, 2020
@nicolasstucki nicolasstucki deleted the add-reflect-symbol-docs branch October 12, 2020 13:16
@Kordyjan Kordyjan added this to the 3.0.0 milestone 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