title: Swift 4.2: [Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector
body: <p>I'm facing a <code>NSInvalidArgumentException</code> exception after upgrading a project to Swift 4.2 (conversion from 4.0).</p>
  
  <pre><code>2018-09-19 15:37:33.253482+0100 &lt;redacted&gt;-beta[3715:1010421] -[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290
  2018-09-19 15:37:33.254312+0100 &lt;redacted&gt;-beta[3715:1010421] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Swift._EmptyArrayStorage _getValue:forType:]: unrecognized selector sent to instance 0x107e6c290'
  </code></pre>
  
  <p>It's something related with a <code>NSMutableAttributedString</code> and the code it's adding some attributes, for example, a <code>NSAttributedString.Key.underlineStyle</code>.</p>
  
  <p>The exception happens when the attributed string is about to be assigned:  <code>textView.attributedText = mutableAttributedString</code>.</p>
  
  <hr>
  
  <h3>UPDATE:</h3>
  
  <p>So, it's was working in Swift 4:
  <strong><code>mutableAttributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.styleNone.rawValue, range: range)</code></strong></p>
  
  <p>Then, with Swift 4.2, the compiler suggests changing the <code>NSUnderlineStyle.styleNone.rawValue</code> to <code>NSUnderlineStyle.none.rawValue</code></p>
  
  <p>After that, the compiler starts yelling "<em>'none' is unavailable: use [] to construct an empty option set</em>":</p>
  
  <pre><code>mutableAttributedString.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.none.rawValue, range: range)
                                                                                     ^~~~~ 'none' is unavailable: use [] to construct an empty option set
  </code></pre>