【发布时间】:2012-10-24 10:10:31
【问题描述】:
我似乎无法从内部类引用中获取外部类成员:
class Outer(st: Int)
{
val valOut = st
def f = 4
class Inner { val x = 5 }
}
object myObj {
val myOut = new Outer(8)
val myIn = new myOut.Inner
val myVal: Int = myIn.valOut//value f is not a member of ... myOut.Inner
val x = myIn.f//value valOut is not a member of ... myOut.Inner
}
我已经在包中尝试过这个,在 Eclipse 工作表中也没有工作。我在 Eclipse 3.7.2 中使用 Scala 2.10.0RC1 和 Scala 插件 2.1.0M2
【问题讨论】:
标签: scala inner-classes