PSA: Type-privacy #4632
thomaseizinger
started this conversation in
General
Replies: 1 comment
-
👍 sounds good to me. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For a while now, we've been making many modules in our plugins private to be able to "freely" modify them. This especially concerns implementations of
ConnectionHandler
and the events around it.Well, I've got bad news: They are not actually private.
It is completely legal to write this today1:
And bam, you've constructed yourself an event that is only meant to be sent by the
ConnectionHandler
to theNetworkBehaviour
. Not sure what to do about this yet but I am leaning towards documenting that these aren't actually public API and doing these kind of shenanigans is setting yourself up for bad times.Footnotes
On nightly. It needs the
#![feature(more_qualified_paths)]
but I am assuming this will stabilise eventually. ↩Beta Was this translation helpful? Give feedback.
All reactions