我正在尝试做这样的事情:
type
User = ref object
email: string
session: Session # ERROR! undeclared identifier 'Session'
type
Session = ref object
key: string
user: User
尼姆有什么办法吗?
答案 0 :(得分:3)
好吧,答案是使用单个“类型”陈述来做到这一点:
type
User = ref object
email: string
session: Session # NO ERROR :)
Session = ref object
key: string
user: User