# lines 11-12:
proc last[T](ll: seq[T]): var T =
return ll[high(ll)]
# line 118:
if last(formula)["state"] == c_empty:
错误:
main.nim(118, 12) Info: template/generic instantiation from here
main.nim(12, 12) Error: expression has no address
编译器想要什么?
最佳答案
[]
不返回 var。
不过,我认为您不需要使用 var 注释此代码段中的任何内容,因为没有任何内容发生变化。如果需要,请在调用站点指定 var。
如果可以的话,尝试在将来提交可编译的示例。
关于nim-lang - 错误: expression has no address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31994863/