Skip to content

Commit 1055156

Browse files
committed
Merge remote-tracking branch 'origin/master' into promotion-rule-2
2 parents ed95b88 + 0dbe970 commit 1055156

File tree

232 files changed

+3011
-1031
lines changed

Some content is hidden

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

232 files changed

+3011
-1031
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,6 @@
184184
[submodule "community-build/community-projects/akka"]
185185
path = community-build/community-projects/akka
186186
url = https://github.com/dotty-staging/akka.git
187+
[submodule "community-build/community-projects/protoquill"]
188+
path = community-build/community-projects/protoquill
189+
url = https://github.com/dotty-staging/protoquill.git
Submodule protoquill added at 5246493

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ final case class SbtCommunityProject(
9191
dependencies: List[CommunityProject] = Nil,
9292
sbtPublishCommand: String = null,
9393
sbtDocCommand: String = null,
94-
scalacOptions: List[String] = List("-Ycheck-init")
94+
scalacOptions: List[String] = SbtCommunityProject.scalacOptions
9595
) extends CommunityProject:
9696
override val binaryName: String = "sbt"
9797

@@ -127,6 +127,12 @@ final case class SbtCommunityProject(
127127
s"--addPluginSbtFile=$sbtPluginFilePath"
128128
)
129129

130+
object SbtCommunityProject:
131+
def scalacOptions = List(
132+
"-Ycheck:macros",
133+
"-Ycheck-init",
134+
)
135+
130136
object projects:
131137

132138
private def forceDoc(projects: String*) =
@@ -452,6 +458,7 @@ object projects:
452458
project = "verify",
453459
sbtTestCommand = "verifyJVM/test",
454460
sbtDocCommand = "verifyJVM/doc",
461+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ycheck:macros") // TODO enable -Ycheck:macros
455462
)
456463

457464
lazy val discipline = SbtCommunityProject(
@@ -473,7 +480,7 @@ object projects:
473480
sbtTestCommand = "test",
474481
sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal",
475482
dependencies = List(discipline),
476-
scalacOptions = Nil // disable -Ycheck-init
483+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ycheck-init")
477484
)
478485

479486
lazy val simulacrumScalafixAnnotations = SbtCommunityProject(
@@ -487,7 +494,8 @@ object projects:
487494
sbtTestCommand = "set scalaJSStage in Global := FastOptStage;buildJVM;validateAllJS",
488495
sbtPublishCommand = "catsJVM/publishLocal;catsJS/publishLocal",
489496
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations),
490-
scalacOptions = Nil // disable -Ycheck-init, due to -Xfatal-warning
497+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ycheck-init") // disable -Ycheck-init, due to -Xfatal-warning
498+
491499
)
492500

493501
lazy val catsMtl = SbtCommunityProject(
@@ -598,6 +606,14 @@ object projects:
598606
dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
599607
)
600608

609+
lazy val protoquill = SbtCommunityProject(
610+
project = "protoquill",
611+
sbtTestCommand = "test",
612+
sbtPublishCommand = "publishLocal",
613+
dependencies = List(), // TODO add scalatest and pprint (see protoquill/build.sbt)
614+
scalacOptions = List("-language:implicitConversions"), // disabled -Ycheck-init, due to bug in macro
615+
)
616+
601617
end projects
602618

603619
def allProjects = List(
@@ -663,6 +679,7 @@ def allProjects = List(
663679
projects.izumiReflect,
664680
projects.perspective,
665681
projects.akka,
682+
projects.protoquill,
666683
)
667684

668685
lazy val projectMap = allProjects.groupBy(_.project)

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class CommunityBuildTestA extends CommunityBuildTest:
108108
@Test def upickle = projects.upickle.run()
109109
@Test def utest = projects.utest.run()
110110
@Test def zio = projects.zio.run()
111+
@Test def protoquill = projects.protoquill.run()
111112

112113
// 'scala-stm' and 'Sciss/Lucre':
113114
// @Test def scissEqual = projects.scissEqual .run()

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
335335
emitAssocs(av, assocs, BCodeHelpers.this)(this)
336336
}
337337

338+
/*
339+
* must-single-thread
340+
*/
341+
def emitParamNames(jmethod: asm.MethodVisitor, params: List[Symbol]) =
342+
for param <- params do
343+
var access = asm.Opcodes.ACC_FINAL
344+
jmethod.visitParameter(param.name.mangledString, access)
345+
338346
/*
339347
* must-single-thread
340348
*/

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
615615
/*
616616
* must-single-thread
617617
*/
618-
def initJMethod(flags: Int, paramAnnotations: List[List[Annotation]]): Unit = {
618+
def initJMethod(flags: Int, params: List[Symbol]): Unit = {
619619

620620
val jgensig = getGenericSignature(methSymbol, claszSymbol)
621621
val (excs, others) = methSymbol.annotations.partition(_.symbol eq defn.ThrowsAnnot)
@@ -637,7 +637,8 @@ trait BCodeSkelBuilder extends BCodeHelpers {
637637
// TODO param names: (m.params map (p => javaName(p.sym)))
638638

639639
emitAnnotations(mnode, others)
640-
emitParamAnnotations(mnode, paramAnnotations)
640+
emitParamNames(mnode, params)
641+
emitParamAnnotations(mnode, params.map(_.annotations))
641642

642643
} // end of method initJMethod
643644

@@ -749,7 +750,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
749750
.addFlagIf(isNative, asm.Opcodes.ACC_NATIVE) // native methods of objects are generated in mirror classes
750751

751752
// TODO needed? for(ann <- m.symbol.annotations) { ann.symbol.initialize }
752-
initJMethod(flags, params.map(p => p.symbol.annotations))
753+
initJMethod(flags, params.map(_.symbol))
753754

754755

755756
if (!isAbstractMethod && !isNative) {

0 commit comments

Comments
 (0)