Sobes.tech
Junior — Senior

Detect defects in the implementation of a Swift structure

livecode

Task condition

The task presents a Swift structure in which there is an error related to modifying a property inside a method. Read the code and identify the problem.

struct Fruit{
    var type:String
    
    func convertToBanana(){
        self.type = "Banana"
    }
}