Skip to content

Commit a3269ef

Browse files
committed
bugfix: Fix issues after backporting
1 parent 9e5bf00 commit a3269ef

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,7 @@ class JSCodeGen()(using genCtx: Context) {
30313031
case singleDim :: Nil =>
30323032
// Use a js.NewArray
30333033
val arrayTypeRef = toTypeRef(arrayClassConstant.typeValue).asInstanceOf[jstpe.ArrayTypeRef]
3034-
js.NewArray(arrayTypeRef, genExpr(singleDim))
3034+
js.NewArray(arrayTypeRef, List(genExpr(singleDim)))
30353035
case _ =>
30363036
// Delegate to jlr.Array.newInstance
30373037
js.ApplyStatic(js.ApplyFlags.empty, JLRArrayClassName, js.MethodIdent(JLRArrayNewInstanceMethodName),
@@ -4852,6 +4852,7 @@ class JSCodeGen()(using genCtx: Context) {
48524852
object JSCodeGen {
48534853

48544854
private val JLRArrayClassName = ClassName("java.lang.reflect.Array")
4855+
private val NullPointerExceptionClass = ClassName("java.lang.NullPointerException")
48554856
private val JSObjectClassName = ClassName("scala.scalajs.js.Object")
48564857
private val JavaScriptExceptionClassName = ClassName("scala.scalajs.js.JavaScriptException")
48574858

compiler/src/dotty/tools/dotc/core/Types.scala

+5-3
Original file line numberDiff line numberDiff line change
@@ -5794,11 +5794,13 @@ object Types extends TypeUtils {
57945794
protected def derivedLambdaType(tp: LambdaType)(formals: List[tp.PInfo], restpe: Type): Type =
57955795
tp.derivedLambdaType(tp.paramNames, formals, restpe)
57965796

5797+
protected def mapArg(arg: Type, tparam: ParamInfo): Type = arg match
5798+
case arg: TypeBounds => this(arg)
5799+
case arg => atVariance(variance * tparam.paramVarianceSign)(this(arg))
5800+
57975801
protected def mapArgs(args: List[Type], tparams: List[ParamInfo]): List[Type] = args match
57985802
case arg :: otherArgs if tparams.nonEmpty =>
5799-
val arg1 = arg match
5800-
case arg: TypeBounds => this(arg)
5801-
case arg => atVariance(variance * tparams.head.paramVarianceSign)(this(arg))
5803+
val arg1 = mapArg(arg, tparams.head)
58025804
val otherArgs1 = mapArgs(otherArgs, tparams.tail)
58035805
if ((arg1 eq arg) && (otherArgs1 eq otherArgs)) args
58045806
else arg1 :: otherArgs1

compiler/src/dotty/tools/dotc/typer/Checking.scala

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import printing.Formatting.hlAsKeyword
4040

4141
import collection.mutable
4242
import reporting.*
43+
import dotty.tools.dotc.core.TypeApplications.TypeParamInfo
4344

4445
object Checking {
4546
import tpd.*

presentation-compiler/src/main/dotty/tools/pc/utils/InteractiveEnrichments.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ object InteractiveEnrichments extends CommonMtagsEnrichments:
281281
sym,
282282
() => parentSymbols.iterator.map(toSemanticdbSymbol).toList.asJava,
283283
contentType,
284-
)
284+
).nn
285285
documentation.nn.toScala
286286
end symbolDocumentation
287287
end extension

0 commit comments

Comments
 (0)