Skip to content

Commit 4d5686c

Browse files
authored
Merge pull request #492 from AVSystem/scala-steward-update/scala-compiler-2.13.12
Scala 2.13.12
2 parents be08c3b + 8bcf823 commit 4d5686c

File tree

7 files changed

+9
-97
lines changed

7 files changed

+9
-97
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
os: [ubuntu-latest]
27-
scala: [2.13.11]
27+
scala: [2.13.12]
2828
java: [temurin@11, temurin@17]
2929
runs-on: ${{ matrix.os }}
3030
steps:
@@ -82,7 +82,7 @@ jobs:
8282
strategy:
8383
matrix:
8484
os: [ubuntu-latest]
85-
scala: [2.13.11]
85+
scala: [2.13.12]
8686
java: [temurin@11]
8787
runs-on: ${{ matrix.os }}
8888
steps:

core/src/main/scala/com/avsystem/commons/meta/metaAnnotations.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,6 @@ final class isAnnotated[T <: StaticAnnotation] extends DirectMetadataParamStrate
278278
*/
279279
final class reifyName(val useRawName: Boolean = false) extends DirectMetadataParamStrategy
280280

281-
/**
282-
* Metadata parameter annotated with this annotation must be of type `SymbolSource` -
283-
* class that holds symbol source information - start & end offsets of symbol definition as well as actual
284-
* source text.
285-
*/
286-
final class reifySource extends DirectMetadataParamStrategy
287-
288281
/**
289282
* Metadata parameter annotated with this annotation must be of type `ParamPosition` or `MethodPosition` -
290283
* a class that holds parameter/method index information - see scaladoc for `ParamPosition` & `MethodPosition`

core/src/test/scala/com/avsystem/commons/misc/SharedExtensionsTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class SharedExtensionsTest extends AnyFunSuite with Matchers {
154154
}
155155

156156
test("sourceCode") {
157-
// for some magical reason does not work on 'Int' type in Scala 2.13.11:
157+
// for some magical reason does not work on 'Int' type in Scala 2.13.12:
158158
// java.lang.NullPointerException: Cannot invoke "scala.reflect.internal.Symbols$Symbol.owner()" because the return value of "scala.reflect.internal.Trees$Tree.symbol()" is null
159159
// scala.tools.nsc.typechecker.Typers$Typer.checkDubiousAdaptation$1(Typers.scala:5330)
160160
// assert(123.sourceCode == "123")

core/src/test/scala/com/avsystem/commons/rpc/SymbolSourceTest.scala

Lines changed: 0 additions & 38 deletions
This file was deleted.

core/src/test/scala/com/avsystem/commons/serialization/CodecTestData.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,6 @@ object CodecTestData {
108108
override def hashCode(): Int = args.hashCode()
109109
}
110110

111-
trait Framework {
112-
type Field
113-
114-
case class Stuff(field: Field)
115-
}
116-
117-
trait BetterFramework extends Framework {
118-
implicit def fieldCodec: GenCodec[Field]
119-
120-
implicit val stuffCodec: GenCodec[Stuff] = GenCodec.materialize
121-
}
122-
123111
object SomeObject {
124112
@generated def random: Int = 42
125113
implicit val codec: GenCodec[SomeObject.type] = GenCodec.materialize[SomeObject.type]

macros/src/main/scala/com/avsystem/commons/macros/meta/MacroMetadatas.scala

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ private[commons] trait MacroMetadatas extends MacroSymbols {
1717
final lazy val ReifyAnnotAT: Type = staticType(tq"$MetaPackage.reifyAnnot")
1818
final lazy val IsAnnotatedAT: Type = staticType(tq"$MetaPackage.isAnnotated[_]")
1919
final lazy val ReifyNameAT: Type = staticType(tq"$MetaPackage.reifyName")
20-
final lazy val ReifySourceAT: Type = staticType(tq"$MetaPackage.reifySource")
2120
final lazy val ReifyPositionAT: Type = staticType(tq"$MetaPackage.reifyPosition")
2221
final lazy val ReifyParamListCountAT: Type = staticType(tq"$MetaPackage.reifyParamListCount")
2322
final lazy val ReifyFlagsAT: Type = staticType(tq"$MetaPackage.reifyFlags")
@@ -157,15 +156,15 @@ private[commons] trait MacroMetadatas extends MacroSymbols {
157156
case t if t <:< InferAT =>
158157
val clue = annot.findArg[String](InferAT.member(TermName("clue")), "")
159158
new ImplicitParam(ownerConstr, paramSym, clue)
160-
case t if t <:< ReifyAnnotAT => new ReifiedAnnotParam(ownerConstr, paramSym)
159+
case t if t <:< ReifyAnnotAT =>
160+
new ReifiedAnnotParam(ownerConstr, paramSym)
161161
case t if t <:< ReifyNameAT =>
162162
val useRawName = annot.findArg[Boolean](ReifyNameAT.member(TermName("useRawName")), false)
163163
new ReifiedNameParam(ownerConstr, paramSym, useRawName)
164-
case t if t <:< ReifySourceAT =>
165-
new ReifiedSourceParam(ownerConstr, paramSym)
166164
case t if t <:< IsAnnotatedAT =>
167165
new IsAnnotatedParam(ownerConstr, paramSym, t.typeArgs.head)
168-
case t => reportProblem(s"metadata param strategy $t is not allowed here")
166+
case t =>
167+
reportProblem(s"metadata param strategy $t is not allowed here")
169168
}
170169

171170
def compositeConstructor(param: CompositeParam): MetadataConstructor
@@ -344,36 +343,6 @@ private[commons] trait MacroMetadatas extends MacroSymbols {
344343
Ok(q"${if (useRawName) matchedSymbol.rawName else matchedSymbol.real.nameStr}")
345344
}
346345

347-
class ReifiedSourceParam(owner: MetadataConstructor, symbol: Symbol)
348-
extends DirectMetadataParam(owner, symbol) {
349-
350-
if (!(actualType =:= SymbolSourceTpe)) {
351-
reportProblem(s"its type is not SymbolSource")
352-
}
353-
354-
def tryMaterializeFor(matchedSymbol: MatchedSymbol): Res[Tree] = {
355-
val sym = matchedSymbol.real.symbol
356-
sym.pos match {
357-
case NoPosition =>
358-
FailMsg(s"source information not available for ${matchedSymbol.real.description}")
359-
case pos => Ok {
360-
val source = pos.source
361-
val startPos = pos.withPoint(pos.start)
362-
val endPos = pos.withPoint(pos.end)
363-
q"""
364-
$MetaPackage.SymbolSource(
365-
${source.path},
366-
${source.file.name},
367-
$MetaPackage.SourceOffset(${startPos.point}, ${startPos.line}, ${startPos.column}),
368-
$MetaPackage.SourceOffset(${endPos.point}, ${endPos.line}, ${endPos.column}),
369-
${new String(source.content, pos.start, pos.end - pos.start)}
370-
)
371-
"""
372-
}
373-
}
374-
}
375-
}
376-
377346
class ParamPositionParam(owner: MetadataConstructor, symbol: Symbol)
378347
extends DirectMetadataParam(owner, symbol) {
379348

project/Commons.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object Commons extends ProjectGroup("commons") {
4040
val circeVersion = "0.14.5" // benchmark only
4141
val upickleVersion = "3.1.2" // benchmark only
4242
val scalajsBenchmarkVersion = "0.10.0"
43-
val slf4jVersion = "2.0.9"
43+
val slf4jVersion = "2.0.9" // test only
4444

4545
// for binary compatibility checking
4646
val previousCompatibleVersions: Set[String] = Set("2.2.4")
@@ -69,7 +69,7 @@ object Commons extends ProjectGroup("commons") {
6969
Developer("ghik", "Roman Janusz", "[email protected]", url("https://github.com/ghik")),
7070
),
7171

72-
scalaVersion := "2.13.11",
72+
scalaVersion := "2.13.12",
7373
compileOrder := CompileOrder.Mixed,
7474

7575
githubWorkflowTargetTags ++= Seq("v*"),

0 commit comments

Comments
 (0)