
上QQ阅读APP看书,第一时间看更新
Default parameter values must be public
The compiler now checks accessibility of referenced objects a bit more strictly; non-literal values that you want to use in public functions as arguments should also be public. Among other things, this exposes an opportunity for optimizing access to the value at the call site. As this may involve API design, the migrator does not suggest fixes, although there are some possibilities for you to consider as an API author:
- Making the referenced default values public
- Providing public functions that return a sensible default value
In both cases, consider the impact of exposing a new API, ensuring that you document your public symbols.