Open LPTK opened 4 years ago
The fine print of this is actually very tricky. The problem in general is that an inline method could be called in a contect where a type it refers to is not accessible. This looks very hard to implement without getting false negatives. Even the limited case of just flagging accesses to private types looks non-trivial. It requires a complete refactoring of the code in checkNoPrivateLeaks
which itself is quite tricky. So, this will be time consuming to do, and the benefits are not that great. I think this is a case where outside contributions would be welcome and not much will happen without them.
minimized code
https://scastie.scala-lang.org/or0Eg6u9Tky1ImaUNEdOug
Compilation output
expectation
This should compile, or at least report an error at the definition site of the
inline
method (similarly to how errors are reported when classes leak private val references), not at call sites.