@@ -986,6 +986,15 @@ object RefChecks {
986
986
report.warning(i " $sym has an unparsable version number: ${ex.getMessage}" , pos)
987
987
case _ =>
988
988
989
+ private def checkSinceAnnotInSignature (sym : Symbol , pos : SrcPos )(using Context ) =
990
+ new TypeTraverser :
991
+ def traverse (tp : Type ) =
992
+ if tp.typeSymbol.hasAnnotation(defn.SinceAnnot ) then
993
+ checkSinceAnnot(tp.typeSymbol, pos)
994
+ else
995
+ traverseChildren(tp)
996
+ .traverse(sym.info)
997
+
989
998
/** If @migration is present (indicating that the symbol has changed semantics between versions),
990
999
* emit a warning.
991
1000
*/
@@ -1272,6 +1281,7 @@ class RefChecks extends MiniPhase { thisPhase =>
1272
1281
checkDeprecatedOvers(tree)
1273
1282
checkExperimentalAnnots(tree.symbol)
1274
1283
checkExperimentalSignature(tree.symbol, tree)
1284
+ checkSinceAnnotInSignature(tree.symbol, tree)
1275
1285
val sym = tree.symbol
1276
1286
if (sym.exists && sym.owner.isTerm) {
1277
1287
tree.rhs match {
@@ -1294,6 +1304,7 @@ class RefChecks extends MiniPhase { thisPhase =>
1294
1304
checkDeprecatedOvers(tree)
1295
1305
checkExperimentalAnnots(tree.symbol)
1296
1306
checkExperimentalSignature(tree.symbol, tree)
1307
+ checkSinceAnnotInSignature(tree.symbol, tree)
1297
1308
checkImplicitNotFoundAnnotation.defDef(tree.symbol.denot)
1298
1309
checkUnaryMethods(tree.symbol)
1299
1310
tree
0 commit comments