Sobes.tech
Middle — Senior
98

Will the Swift snippet compile? (variant 2)

Companies where asked:

СБЕРСБЕР
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)