我正在使用 Eclipse IDE。第一个构造函数是可调用的,但不是第二个。我想知道 xtend 是否支持多个构造函数?
@Data abstract class MatchingBase implements TidilySerializable {
val List<Integer> connections
new (int componentSize) {
connections = (0 ..< componentSize).toList
}
new (List<Integer> conn) {
connections = new ArrayList<Integer>()
for (int i : 0 ..< componentSize)
connections.add(conn.get(i))
}
}
@Data class Permutation extends MatchingBase {
}
然后,如果我new Permutation(new ArrayList<Integer>())在 Eclipse 中调用,则会将其强调为编译时错误。