Avatar
コンパイラエラーのalready lazyは所謂@lazyとは意味合いが違うということですね、なるほど
10:21 AM
ちょっとこの辺り気になって上記のvaluexxxxxxxxxxとリネームした状態でSILを吐いてみたのですが、 // static Class.xxxxxxxxxx.setter sil hidden [transparent] @_T04main5ClassC10xxxxxxxxxxSivsZ : $@convention(method) (Int, @thick Class.Type) -> () { // %0 // users: %8, %2 // %1 // user: %3 bb0(%0 : $Int, %1 : $@thick Class.Type): debug_value %0 : $Int, let, name "value", argno 1 // id: %2 debug_value %1 : $@thick Class.Type, let, name "self", argno 2 // id: %3 // function_ref Class.xxxxxxxxxx.unsafeMutableAddressor %4 = function_ref @_T04main5ClassC10xxxxxxxxxxSivau : $@convention(thin) () -> Builtin.RawPointer // user: %5 %5 = apply %4() : $@convention(thin) () -> Builtin.RawPointer // user: %6 %6 = pointer_to_address %5 : $Builtin.RawPointer to [strict] $*Int // user: %7 %7 = begin_access [modify] [dynamic] %6 : $*Int // users: %9, %8 assign %0 to %7 : $*Int // id: %8 end_access %7 : $*Int // id: %9 %10 = tuple () // user: %11 return %10 : $() // id: %11 } // end sil function '_T04main5ClassC10xxxxxxxxxxSivsZ' %5 = apply %4() : $@convention(thin) () -> Builtin.RawPointer // user: %6 ここで代入前に初期化(preconditionFailure)されてしまっているということなのでしょうか…? SIL全然読めないのでついていけなくなったらすいません