Skip to content

Commit

Permalink
Allow JS Symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mbovel committed Oct 25, 2024
1 parent 158cd6e commit 94a69db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ class Definitions {
@tu lazy val DummyImplicitClass: ClassSymbol = requiredClass("scala.DummyImplicit")

@tu lazy val SymbolModule: Symbol = requiredModule("scala.Symbol")
@tu lazy val JSSymbolModule: Symbol = requiredModule("scala.scalajs.js.Symbol")

@tu lazy val ScalaRuntimeModule: Symbol = requiredModule("scala.runtime.ScalaRunTime")
def runtimeMethodRef(name: PreName): TermRef = ScalaRuntimeModule.requiredMethodRef(name)
Expand Down
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ object Checking {
qual.symbol == defn.ArrayModule
|| qual.symbol == defn.ClassTagModule // class tags are used as arguments to Array.apply
|| qual.symbol == defn.SymbolModule // used in Akka
|| qual.symbol == defn.JSSymbolModule // used in Scala.js
|| isTupleModule(qual.symbol)
case Select(New(clazz), nme.CONSTRUCTOR) => clazz.symbol.isAnnotation
case Apply(fun, _) => isFunctionAllowed(fun)
Expand Down

0 comments on commit 94a69db

Please sign in to comment.