Swift
Use of self

by Tommaso Piazza

let superImportantConst: Int = 42

func bar() {
  // do bar
}

struct Something {
  let importantValue: Int = -42

  func doFoo(with: Int) {
   // omitted
  }
  
  func doBaz() {
   
   self.doFoo(self.importantValue)
  }
}

let superImportantConst: Int = 42

func bar() {
  // do bar
}

struct Something {
  let importantValue: Int = -42

  func doFoo(with: Int) {
   // omitted
  }
  
  func doBaz() {
   
   doFoo(importantValue)
  }
}