Skip to content

How to debug Symbol completion/creation? #11893

Discussion options

You must be logged in to vote

Symbols have hash codes that are stable between compiler runs. To find out what creates a Symbol, first find out its hash code, then simply print a stack trace in Symbol's constructor when the hash code matches. The stack trace will probably contain some new* methods in Symbols.scala.

When a symbol is created, its .info is set to a lazy type. This lazy type will later be used to actually calculate the .info for the symbol (see complete and doComplete in SymbolLoader). One way to debug information about the completion of the symbol is to print information when the symbol with the correct hash code is being completed.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@abgruszecki
Comment options

@smarter
Comment options

smarter Mar 25, 2021
Collaborator

Answer selected by abgruszecki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants