@@ -298,9 +298,10 @@ object RefChecks {
298298 * 1.9. If M is erased, O is erased. If O is erased, M is erased or inline.
299299 * 1.10. If O is inline (and deferred, otherwise O would be final), M must be inline
300300 * 1.11. If O is a Scala-2 macro, M must be a Scala-2 macro.
301- * 1.12. If O is non-experimental, M must be non-experimental.
302- * 1.13 Under -source future, if O is a val parameter, M must be a val parameter
301+ * 1.12. Under -source future, if O is a val parameter, M must be a val parameter
303302 * that passes its value on to O.
303+ * 1.13. If O is non-experimental, M must be non-experimental.
304+ * 1.14. If O has @publicInBinary, M must have @publicInBinary.
304305 * 2. Check that only abstract classes have deferred members
305306 * 3. Check that concrete classes do not have deferred definitions
306307 * that are not implemented in a subclass.
@@ -571,13 +572,15 @@ object RefChecks {
571572 overrideError(i " needs to be declared with @targetName( ${" \" " }${other.targetName}${" \" " }) so that external names match " )
572573 else
573574 overrideError(" cannot have a @targetName annotation since external names would be different" )
574- else if other.is(ParamAccessor ) && ! isInheritedAccessor(member, other) then // (1.13 )
575+ else if other.is(ParamAccessor ) && ! isInheritedAccessor(member, other) then // (1.12 )
575576 report.errorOrMigrationWarning(
576577 em " cannot override val parameter ${other.showLocated}" ,
577578 member.srcPos,
578579 MigrationVersion .OverrideValParameter )
579- else if ! other.isExperimental && member.hasAnnotation(defn.ExperimentalAnnot ) then // (1.12 )
580+ else if ! other.isExperimental && member.hasAnnotation(defn.ExperimentalAnnot ) then // (1.13 )
580581 overrideError(" may not override non-experimental member" )
582+ else if ! member.hasAnnotation(defn.PublicInBinaryAnnot ) && other.hasAnnotation(defn.PublicInBinaryAnnot ) then // (1.14)
583+ overrideError(" also needs to be declared with @publicInBinary" )
581584 else if other.hasAnnotation(defn.DeprecatedOverridingAnnot ) then
582585 overrideDeprecation(" " , member, other, " removed or renamed" )
583586 end checkOverride
0 commit comments