是的,这会导致此错误-无法在属性初始化程序中使用实例成员'getA';属性初始化程序在“自我”可用之前运行
class A { var asd : String = getA() func getA() -> String { return "A" } }
variables class swift swift3
class ×1
swift ×1
swift3 ×1
variables ×1