How about allowing file-private receivers to be us...
# language-proposals
b
How about allowing file-private receivers to be used in public functions? I could see this solving the need for a file-private accessibility modifier, and I can't thing of any immediate hard reasons this shouldn't work. I can see it being unintuitive, like accidentally using a file-private receiver and not knowing why it's missing from intellisense in other files, even if the receiver functions have a public modifier. Could be a suppressible warning but then it'd feel like a hack or awkward (I'm assuming
context
here is also an error, but just not reported as one yet since it's a prototype/experimental)
s
In Java you can't have parameters of an unexposed type. Receivers are implemented as parameters. Hence it can't do that. Besides, I'm not entirely sure I see the point.
x
A receiver is the same as the first parameter - and you can't send private symbols as parameters of a public function