Skip to content

Commit a4854c5

Browse files
committed
Remove @reifySource unsupported by new Scala version 2.13.12
1 parent 5aa143a commit a4854c5

File tree

4 files changed

+5
-81
lines changed

4 files changed

+5
-81
lines changed

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/rpc/SymbolSourceTest.scala

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

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: 1 addition & 1 deletion
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")

0 commit comments

Comments
 (0)