Scala 2.8 中封装 private 修饰符
如果我尝试,
private[com.company.foo] def bar(xml: XmlPath) = {
我会得到
[error] ... ']' expected but '.' found.
[error] private[com.
[error] ^
那是怎么回事?我只能将其设为 com.* 的包私有,或者...?
If I try
private[com.company.foo] def bar(xml: XmlPath) = {
I get
[error] ... ']' expected but '.' found.
[error] private[com.
[error] ^
What's with that? I can only make it package-private to com.*, or...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能定义封闭包,其中定义了代码:
如果要将其设置为公司:
You can only define the enclosing package, within which the code is defined:
and if you want to set it to company: