title: String literals in lazy vars in Swift 2 / XCode 7 [Cannot convert value of type String ...]
body: <p>Whenever a String literal appears in the declaration of a <code>lazy var</code> I get a compilation error in Swift 2 / XCode 7: <code>Cannot convert value of type String to expected argument type '(_builtinStringLiteral: RawPointer, byteSize: Word, isASCII: Int1)' ...</code></p>
  
  <p>(I had no problems in Swift 1.2 / XCode 6)</p>
  
  <p>The simplest line that produces this error looks something like this:</p>
  
  <pre><code>lazy var foo = "bar"
  </code></pre>
  
  <p>But more relevantly (annoyingly), it also happens with initializers that take string arguments:</p>
  
  <pre><code>lazy var viewsLabel = HWLabel(color: COLOR_WHITE, font: ProximaNova("Semibold", 13))
  lazy var durationIconView = HWIconView(imageName: "TimeIcon", color: COLOR_WHITE)
  </code></pre>
  
  <p>These are obviously my own initializers, and I'm noticing Apple SDKs don't seem to have Strings as args in initializers very often. Are Strings in <code>init</code>s bad practice?</p>
  
  <p><del>What does work is wrapping the declaration in a block.</del></p>
  
  <p>I might do that for now, or just make them not <code>lazy</code>.</p>
  
  <p>I'm still curious though. Is this an XCode 7 bug?</p>
  
  <p><em><strong>UPDATE:</strong></em></p>
  
  <p>Just noticed that what does work is <strong>not</strong> wrapping the declaration in a closure, but rather specifying the type of the var so that it's not inferred.</p>
  
  <p>So, <strong>what does work</strong>:</p>
  
  <pre><code>lazy var viewsLabel: HWLabel = HWLabel(color: COLOR_WHITE, font: ProximaNova("Semibold", 13))
  lazy var durationIconView: HWIconView = HWIconView(imageName: "TimeIcon", color: COLOR_WHITE)
  </code></pre>
  
  <p>Why the appearance of a String in a <code>lazy var</code> declaration messes with type inference is beyond me. Still have a hunch it might be an XCode 7 bug.</p>