Created
March 28, 2019 12:25
-
-
Save plu/bb4495c758f15104a4365b2e0ce4de24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class A { | |
init(completion: @escaping () -> Void) {} | |
} | |
class B { | |
init(a: A) {} | |
} | |
class C { | |
lazy var a = A { [weak self] in | |
guard let self = self else { return } | |
self.printB() | |
// Uncomment next line and get a compile error | |
// debugPrint(self.b) | |
} | |
lazy var b = B(a: self.a) | |
func printB() { | |
debugPrint(b) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment