-1
我有以下斯卡拉类:斯卡拉不能访问现场
class Component(val node:Int, var start:Int, var c_size:Int)
我实例是这样的:
var comp = new Component(1, 1, 1)
然后,我尝试访问它的领域之一:
for(neighbour <- graph[comp.node]) ...
但是,此时出现错误:
error: type node is not a member of Component
为什么字段不被识别?
你可以发表声明或类型的'graph'吗? – Gonfva
尝试使用图形(comp.node)。 – Nyavro
@Nyavro就是这样。 – octavian