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
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -542,7 +542,8 @@ object Checking {
542
542
if sym.is(Enum) then fail(em"@publicInBinary cannot be used on enum definitions")
543
543
elseif sym.isType &&!sym.is(Module) &&!(sym.is(Given) || sym.companionModule.is(Given)) then fail(em"@publicInBinary cannot be used on ${sym.showKind} definitions")
544
544
elseif!sym.owner.isClass &&!(sym.is(Param) && sym.owner.isConstructor) then fail(em"@publicInBinary cannot be used on local definitions")
545
-
elseif sym.is(Private) &&!sym.privateWithin.exists &&!sym.isConstructor then fail(em"@publicInBinary cannot be used on private definitions\n\nThe definition could be `private[${sym.owner.name}]` or `protected` instead")
545
+
elseif sym.is(ParamAccessor) && sym.is(Private) then fail(em"@publicInBinary cannot be non `val` constructor parameters")
546
+
elseif sym.is(Private) &&!sym.privateWithin.exists &&!sym.isConstructor then fail(em"@publicInBinary cannot be used on private definitions\n\nConsider using `private[${sym.owner.name}]` or `protected` instead")
0 commit comments