Skip to content

Commit b177728

Browse files
committed
Disable specialization for Scala.js
1 parent 5fa9fff commit b177728

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package dotty.tools.dotc
22
package transform
33

44
import ast.Trees._, ast.tpd, core._
5-
import Contexts.Context, Types._, Decorators._, Symbols._, DenotTransformers._
5+
import Contexts._, Types._, Decorators._, Symbols._, DenotTransformers._
66
import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._
77
import MegaPhase.MiniPhase
88

@@ -16,6 +16,9 @@ class SpecializeFunctions extends MiniPhase with InfoTransformer {
1616
val phaseName = "specializeFunctions"
1717
override def runsAfter = Set(ElimByName.name)
1818

19+
override def isEnabled(using Context): Boolean =
20+
!ctx.settings.scalajs.value
21+
1922
override def infoMayChange(sym: Symbol)(using Context): Boolean =
2023
!sym.is(Flags.Package) && sym.isDefinedInCurrentRun
2124

compiler/src/dotty/tools/dotc/transform/SpecializedApplyMethods.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class SpecializedApplyMethods extends MiniPhase with InfoTransformer {
2222

2323
val phaseName = "specializedApplyMethods"
2424

25+
override def isEnabled(using Context): Boolean =
26+
!ctx.settings.scalajs.value
27+
2528
private def specApplySymbol(sym: Symbol, args: List[Type], ret: Type)(using Context): Symbol = {
2629
val name = nme.apply.specializedFunction(ret, args)
2730
// Create the symbol at the next phase, so that it is a valid member of the

0 commit comments

Comments
 (0)