You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/typer/Checking.scala
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -530,7 +530,7 @@ object Checking {
530
530
if sym.is(Enum) then fail(em"@binaryAPI cannot be used on enum definitions.")
531
531
elseif sym.isType &&!sym.is(Module) &&!(sym.is(Given) || sym.companionModule.is(Given)) then fail(em"@binaryAPI cannot be used on ${sym.showKind} definitions")
532
532
elseif!sym.owner.isClass &&!(sym.is(Param) && sym.owner.isConstructor) then fail(em"@binaryAPI cannot be used on local definitions.")
533
-
elseif sym.is(Private) then fail(em"@binaryAPI cannot be used on private definitions.\n\nCould the definition `private[${sym.owner.name}]` or `protected` instead or use `@binaryAPIAccessor` instead of `@binaryAPI`.")
533
+
elseif sym.is(Private) &&!sym.isConstructor then fail(em"@binaryAPI cannot be used on private definitions.\n\nCould the definition `private[${sym.owner.name}]` or `protected` instead or use `@binaryAPIAccessor` instead of `@binaryAPI`.")
534
534
if sym.hasAnnotation(defn.BinaryAPIAccessorAnnot) then
535
535
if sym.is(Enum) then fail(em"@binaryAPIAccessor cannot be used on enum definitions.")
536
536
elseif sym.isConstructor then fail(em"@binaryAPIAccessor cannot be used on constructors.")
0 commit comments