A small Swift program shows how two screens use the same object-based state model. The task is to determine exactly what text will be printed to stdout after the model is replaced sequentially and the state is read again.
-swift-version 6 mode.class; the screens store a reference to it.Main.swift.swiftc -swift-version 6 Main.swift -o app && ./app
The program should print exactly one line to stdout:
A=2 B=1
There must be no additional lines, no trailing spaces, and no line break inside the string.
Main.swift is compiled via swiftc -swift-version 6Click a line and write what it prints. Explanation is optional.