title: Closure : Use unresolved identifier 'self'
body: <p>I'm parsing the Swift Language Guide tutorial (from Apple iOS dev library) and for every chapter I create a separate swift file.
  In each file I create multiple functions where I isolate snippets of code that they provide. Everything worked on until testing the Strong Reference Cycles for Closures. 
   For some reason if the class that contains a closure (for a computed property) is declared inside a function, then the closure cannot see the "self" reference of the enclosing class.  Any ideas why ? 
   It works fine if the class is not declared inside a function.</p>
  
  <pre><code>func strongRefClosure() {
      class HTMLElement {
  
          let name: String
          let text: String?
  
          lazy var asHTML: () -&gt; String = {
              if let text = self.text {
                  return "&lt;\(self.name)&gt;\(text)&lt;/\(self.name)&gt;"
              } else {
                  return "&lt;\(self.name) /&gt;"
              }
          }
  
          init(name: String, text: String? = nil) {
              self.name = name
              self.text = text
          }
  
          deinit {
              println("\(name) is being deinitialized")
          }
      }
  
      var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
      println(paragraph!.asHTML())
  }
  </code></pre>