@@ -986,6 +986,15 @@ object RefChecks {
986986 report.warning(i " $sym has an unparsable version number: ${ex.getMessage}" , pos)
987987 case _ =>
988988
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+
989998 /** If @migration is present (indicating that the symbol has changed semantics between versions),
990999 * emit a warning.
9911000 */
@@ -1272,6 +1281,7 @@ class RefChecks extends MiniPhase { thisPhase =>
12721281 checkDeprecatedOvers(tree)
12731282 checkExperimentalAnnots(tree.symbol)
12741283 checkExperimentalSignature(tree.symbol, tree)
1284+ checkSinceAnnotInSignature(tree.symbol, tree)
12751285 val sym = tree.symbol
12761286 if (sym.exists && sym.owner.isTerm) {
12771287 tree.rhs match {
@@ -1294,6 +1304,7 @@ class RefChecks extends MiniPhase { thisPhase =>
12941304 checkDeprecatedOvers(tree)
12951305 checkExperimentalAnnots(tree.symbol)
12961306 checkExperimentalSignature(tree.symbol, tree)
1307+ checkSinceAnnotInSignature(tree.symbol, tree)
12971308 checkImplicitNotFoundAnnotation.defDef(tree.symbol.denot)
12981309 checkUnaryMethods(tree.symbol)
12991310 tree
0 commit comments