Skip to content

Symbol.isDefinedInCurrentRun can throw ClassCastException #13095

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
scf37 opened this issue Jul 17, 2021 · 0 comments · Fixed by #13157
Closed

Symbol.isDefinedInCurrentRun can throw ClassCastException #13095

scf37 opened this issue Jul 17, 2021 · 0 comments · Fixed by #13157
Assignees

Comments

@scf37
Copy link

scf37 commented Jul 17, 2021

Compiler version

3.0.1

Minimized code

Walk through Symbol hierarchy calling isDefinedInCurrentRun on every Symbol encountered.
I guess NoSymbol.isDefinedInCurrentRun should throw

Output (click arrow to expand)

[error]    |java.lang.ClassCastException: dotty.tools.dotc.core.Symbols$NoSymbol$ cannot be cast to dotty.tools.dotc.core.Symbols$ClassSymbol
[error]    |    at dotty.tools.dotc.core.Symbols$Symbol.asClass(Symbols.scala:172)
[error]    |    at scala.quoted.runtime.impl.QuotesImpl$reflect$SymbolMethods$.isDefinedInCurrentRun(QuotesImpl.scala:2458)
[error]    |    at scala.quoted.runtime.impl.QuotesImpl$reflect$SymbolMethods$.isDefinedInCurrentRun(QuotesImpl.scala:2457)
[error]    |    at MacroVis.$init$$$anonfun$14(MacroVis.scala:20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants