Skip to content

Commit 2a3b3c2

Browse files
authored
Merge branch 'main' into sbt-1.8.0
2 parents 4a97ede + 8fba321 commit 2a3b3c2

File tree

330 files changed

+9135
-7698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+9135
-7698
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import dotty.tools.dotc.transform.SymUtils._
2323
import dotty.tools.dotc.util.Spans._
2424
import dotty.tools.dotc.core.Contexts._
2525
import dotty.tools.dotc.core.Phases._
26+
import dotty.tools.dotc.core.Decorators.em
2627
import dotty.tools.dotc.report
2728

2829
/*
@@ -700,7 +701,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
700701
var elemKind = arr.elementType
701702
val argsSize = args.length
702703
if (argsSize > dims) {
703-
report.error(s"too many arguments for array constructor: found ${args.length} but array has only $dims dimension(s)", ctx.source.atSpan(app.span))
704+
report.error(em"too many arguments for array constructor: found ${args.length} but array has only $dims dimension(s)", ctx.source.atSpan(app.span))
704705
}
705706
if (argsSize < dims) {
706707
/* In one step:

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
7979
outputDirectory
8080
} catch {
8181
case ex: Throwable =>
82-
report.error(s"Couldn't create file for class $cName\n${ex.getMessage}", ctx.source.atSpan(csym.span))
82+
report.error(em"Couldn't create file for class $cName\n${ex.getMessage}", ctx.source.atSpan(csym.span))
8383
null
8484
}
8585
}
@@ -422,7 +422,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
422422
emitAssocs(nestedVisitor, assocs, bcodeStore)(innerClasesStore)
423423

424424
case t =>
425-
report.error(ex"Annotation argument is not a constant", t.sourcePos)
425+
report.error(em"Annotation argument is not a constant", t.sourcePos)
426426
}
427427
}
428428

@@ -871,10 +871,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
871871
try body
872872
catch {
873873
case ex: Throwable =>
874-
report.error(i"""|compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
875-
|signature: $sig
876-
|if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues
877-
""".trim, sym.sourcePos)
874+
report.error(
875+
em"""|compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
876+
|signature: $sig
877+
|if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues
878+
""", sym.sourcePos)
878879
throw ex
879880
}
880881
}

compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
748748

749749
if (params.size > MaximumJvmParameters) {
750750
// SI-7324
751-
report.error(s"Platform restriction: a parameter list's length cannot exceed $MaximumJvmParameters.", ctx.source.atSpan(methSymbol.span))
751+
report.error(em"Platform restriction: a parameter list's length cannot exceed $MaximumJvmParameters.", ctx.source.atSpan(methSymbol.span))
752752
return
753753
}
754754

@@ -800,9 +800,10 @@ trait BCodeSkelBuilder extends BCodeHelpers {
800800
val veryFirstProgramPoint = currProgramPoint()
801801

802802
if trimmedRhs == tpd.EmptyTree then
803-
report.error("Concrete method has no definition: " + dd + (
804-
if (ctx.settings.Ydebug.value) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
805-
else ""),
803+
report.error(
804+
em"Concrete method has no definition: $dd${
805+
if (ctx.settings.Ydebug.value) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
806+
else ""}",
806807
ctx.source.atSpan(NoSpan)
807808
)
808809
else

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Contexts._
1414
import Types._
1515
import Symbols._
1616
import Phases._
17+
import Decorators.em
1718

1819
import dotty.tools.dotc.util.ReadOnlyMap
1920
import dotty.tools.dotc.report
@@ -71,7 +72,7 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
7172
def _1: Type = field.tpe match {
7273
case JavaArrayType(elem) => elem
7374
case _ =>
74-
report.error(s"JavaSeqArray with type ${field.tpe} reached backend: $field", ctx.source.atSpan(field.span))
75+
report.error(em"JavaSeqArray with type ${field.tpe} reached backend: $field", ctx.source.atSpan(field.span))
7576
UnspecifiedErrorType
7677
}
7778
def _2: List[Tree] = field.elems

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import dotty.tools.dotc.sbt.ExtractDependencies
2121
import Contexts._
2222
import Phases._
2323
import Symbols._
24+
import Decorators.em
2425

2526
import java.io.DataOutputStream
2627
import java.nio.channels.ClosedByInterruptException
@@ -308,7 +309,7 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
308309
getFileForClassfile(outF, cls.name, ".class")
309310
} catch {
310311
case e: FileConflictException =>
311-
report.error(s"error writing ${cls.name}: ${e.getMessage}")
312+
report.error(em"error writing ${cls.name}: ${e.getMessage}")
312313
null
313314
}
314315
} else null
@@ -608,11 +609,11 @@ class GenBCodePipeline(val int: DottyBackendInterface, val primitives: DottyPrim
608609
val method =
609610
s"${e.getClassName.replaceAll("/", ".")}.${e.getMethodName}"
610611
val msg =
611-
s"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
612+
em"Generated bytecode for method '$method' is too large. Size: ${e.getCodeSize} bytes. Limit is 64KB"
612613
report.error(msg)
613614
case e: ClassTooLargeException =>
614615
val msg =
615-
s"Class '${e.getClassName.replaceAll("/", ".")}' is too large. Constant pool size: ${e.getConstantPoolCount}. Limit is 64K entries"
616+
em"Class '${e.getClassName.replaceAll("/", ".")}' is too large. Constant pool size: ${e.getConstantPoolCount}. Limit is 64K entries"
616617
report.error(msg)
617618

618619
}

compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Contexts._
88
import Names.TermName, StdNames._
99
import Types.{JavaArrayType, UnspecifiedErrorType, Type}
1010
import Symbols.{Symbol, NoSymbol}
11+
import Decorators.em
1112
import dotc.report
1213
import dotc.util.ReadOnlyMap
1314

@@ -66,7 +67,7 @@ class DottyPrimitives(ictx: Context) {
6667
case defn.ArrayOf(el) => el
6768
case JavaArrayType(el) => el
6869
case _ =>
69-
report.error(s"expected Array $tpe")
70+
report.error(em"expected Array $tpe")
7071
UnspecifiedErrorType
7172
}
7273

@@ -133,7 +134,7 @@ class DottyPrimitives(ictx: Context) {
133134
def addPrimitives(cls: Symbol, method: TermName, code: Int)(using Context): Unit = {
134135
val alts = cls.info.member(method).alternatives.map(_.symbol)
135136
if (alts.isEmpty)
136-
report.error(s"Unknown primitive method $cls.$method")
137+
report.error(em"Unknown primitive method $cls.$method")
137138
else alts foreach (s =>
138139
addPrimitive(s,
139140
s.info.paramInfoss match {

0 commit comments

Comments
 (0)