Adding convenience initializer with same argument names but different types crashes Xcode

Originator:mail
Number:rdar://17221567 Date Originated:2014-06-08
Status:Open Resolved:
Product:Swift Product Version:
Classification: Reproducible:
 
Summary:
SKColor has the following init method:

init(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)

If I add a new convenience initializer that has the same parameter names but uses different types (for example, Int), then Xcode crashes.

Steps to Reproduce:
Type the following into an Xcode playground:

import Cocoa
import SpriteKit

extension SKColor {
  convenience init(red: Int, green: Int, blue: Int, alpha: Float) {
    return self.init(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0)
  }
}

Wait a second for Xcode to crash.

Expected Results:
SKColor really should get a new init method that lets me pass in integer values instead of floats.

Actual Results:
Xcode crashed.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!