Sobes.tech
Middle — Senior

Will the Swift snippet compile? (variant 2)

livecode

Task condition

Determine whether the following Swift program compiles without errors. Pay attention to actor isolation rules when accessing properties from outside the actor.

actor Main {
    let a = 0
    var b = 0
}

let mainObject = Main()

print(mainObject.a)
print(mainObject.b)