NSTextContainer.maximumNumberOfLines error: cannot assign value of type 'Int' to type 'UInt'

Originator:robbert
Number:rdar://33795982 Date Originated:August 9 2017
Status:Resolved Resolved:Xcode 9.3
Product:iOS + SDK Product Version:Xcode 8.3.3
Classification:Bug Reproducible:Always
 
When using the maximumNumberOfLines property of NSTextContainer with Swift, building fails with"error: cannot assign value of type 'Int' to type 'UInt'".

Steps to Reproduce:
Create test.swift:
==========================================
import UIKit

let a = NSTextContainer(size: CGSize.zero)
let i = Int(1)

a.maximumNumberOfLines = i
==========================================

$ xcrun swift -frontend -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -target x86_64-apple-ios8.0 -emit-object -o . -module-cache-path $(mktemp -d) test.swift -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks

Compilation fails.

When removing the framework search path "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks", the compilation does succeed:

$ xcrun swift -frontend -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -target x86_64-apple-ios8.0 -emit-object -o . -module-cache-path $(mktemp -d) test.swift

Expected Results:
Compilation passes regardless of the framework search path.

Observed Results:
Compilation fails depending on a correct framework search path.

Version:
Xcode 8.3.3

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!