Skip to content

Commit 169206c

Browse files
committed
airframe-surface: Use the fixed declaredTypes in Scala 3.3.0 scala/scala3#15033
1 parent 6179fb5 commit 169206c

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

airframe-metrics/src/main/scala/wvlet/airframe/metrics/Count.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ case class Count(value: Long, unit: CountUnit) extends Comparable[Count] {
6666
}
6767
}
6868

69-
/**
70-
*/
7169
object Count {
7270
Zero.register(Surface.of[CountUnit], ONE)
7371
Zero.register(Surface.of[Count], Count(0))

airframe-surface/src/main/scala-3/wvlet/airframe/surface/CompileTimeSurfaceFactory.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private[surface] object CompileTimeSurfaceFactory {
1313
val surfaceExpr = f.surfaceOf(tpe)
1414
val t = TypeRepr.of[A]
1515
val flags = t.typeSymbol.flags
16-
if (!flags.is(Flags.Static) && flags.is(Flags.NoInits)) {
16+
if (!flags.is(Flags.JavaStatic) && flags.is(Flags.NoInits)) {
1717
t.typeSymbol.maybeOwner match {
1818
// For inner-class definitions
1919
case s: Symbol
@@ -397,7 +397,7 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q) {
397397
}
398398

399399
private def isPathDependentType(t: TypeRepr): Boolean = {
400-
!t.typeSymbol.flags.is(Flags.Static) && (t match {
400+
!t.typeSymbol.flags.is(Flags.JavaStatic) && (t match {
401401
case t: TypeBounds => true
402402
case _ => false
403403
})
@@ -500,9 +500,10 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q) {
500500
val typeArgTable: Map[String, TypeRepr] = typeMappingTable(t, method)
501501

502502
val origParamSymss = method.paramSymss
503-
val typeMembers = t.typeSymbol.typeMembers.filterNot(_.flags.is(Flags.Module))
503+
504+
val declaredTypes = t.typeSymbol.declaredTypes.filterNot(_.flags.is(Flags.Module))
504505
val paramss = {
505-
if (origParamSymss.nonEmpty && typeMembers.nonEmpty)
506+
if (origParamSymss.nonEmpty && declaredTypes.nonEmpty)
506507
origParamSymss.tail
507508
else {
508509
origParamSymss
@@ -816,7 +817,7 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q) {
816817
if (m.flags.is(Flags.Protected)) {
817818
mod |= MethodModifier.PROTECTED
818819
}
819-
if (m.flags.is(Flags.Static)) {
820+
if (m.flags.is(Flags.JavaStatic)) {
820821
mod |= MethodModifier.STATIC
821822
}
822823
if (m.flags.is(Flags.Final)) {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ lazy val benchmark =
828828
// For grpc-java
829829
"io.grpc" % "grpc-protobuf" % GRPC_VERSION,
830830
"com.google.protobuf" % "protobuf-java" % "3.23.1",
831-
"com.chatwork" %% "scala-ulid" % "1.0.24"
831+
("com.chatwork" %% "scala-ulid" % "1.0.24").cross(CrossVersion.for3Use2_13)
832832
)
833833
// Compile / PB.targets := Seq(
834834
// scalapb.gen() -> (sourceManaged in Compile).value / "scalapb"

0 commit comments

Comments
 (0)