title: NSRect.fill() not working with clear colors on Xcode 9 Swift 4
body: <p>Swift 4 has a new NSRect.fill() function to replace NSRectFill().  When attempting to clear a bitmap using NSColor.clear.setFill(), the bitmap remains unchanged using NSRect.fill().</p>
  
  <p>A workaround is to use NSRect.fill(using:) and specifying .copy.</p>
  
  <p>Here is what the code does in Playgrounds in Swift 4:
  <a href="https://i.stack.imgur.com/m9XvC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m9XvC.png" alt="Swift 4"></a></p>
  
  <p>Sample code:</p>
  
  <pre><code>// Duplicating a bug with Xcode 9 and Swift 4
  
  import Cocoa
  
  var image = NSImage(size: NSSize(width: 32, height: 32))
  let rect = NSRect(x: 0, y: 0, width: image.size.width, height: image.size.height)
  image.lockFocus()
  NSColor.red.setFill()
  rect.fill()
  image.unlockFocus()
  image.lockFocus()
  NSColor.clear.setFill()
  // calling fill() with a clear color does not work
  rect.fill()
  image.unlockFocus()
  // Image above should not be red
  image.lockFocus()
  NSColor.clear.setFill()
  // using fill(using:) does work
  rect.fill(using: .copy)
  image.unlockFocus()
  // image above is properly cleared
  </code></pre>
  
  <p>Is this a bug that I should file with Apple or am I missing something?  This sequence worked in Swift 3 using NSRectFill().</p>
  
  <p>Here is Swift 3 using NSRectFill:
  <a href="https://i.stack.imgur.com/LGb6b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LGb6b.png" alt="Swift 3"></a></p>