@@ -298,9 +298,10 @@ object RefChecks {
298
298
* 1.9. If M is erased, O is erased. If O is erased, M is erased or inline.
299
299
* 1.10. If O is inline (and deferred, otherwise O would be final), M must be inline
300
300
* 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
303
302
* 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.
304
305
* 2. Check that only abstract classes have deferred members
305
306
* 3. Check that concrete classes do not have deferred definitions
306
307
* that are not implemented in a subclass.
@@ -571,13 +572,15 @@ object RefChecks {
571
572
overrideError(i " needs to be declared with @targetName( ${" \" " }${other.targetName}${" \" " }) so that external names match " )
572
573
else
573
574
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 )
575
576
report.errorOrMigrationWarning(
576
577
em " cannot override val parameter ${other.showLocated}" ,
577
578
member.srcPos,
578
579
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 )
580
581
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" )
581
584
else if other.hasAnnotation(defn.DeprecatedOverridingAnnot ) then
582
585
overrideDeprecation(" " , member, other, " removed or renamed" )
583
586
end checkOverride
0 commit comments