Skip to content

Symbol.isDefinedInCurrentRun can throw ClassCastException #13095

Closed
@scf37

Description

@scf37

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions