LLDB RPC Server crashing in Playground

Originator:mkchoi212
Number:rdar://32786809 Date Originated:June 15 2017
Status:Open Resolved:
Product:Xcode Playground Product Version:8.3.3
Classification:Bug Reproducible:Always
 
Summary:
When a function with a protocol as a generic constraint is sent a mismatched parameter, Xcode project simply segment faults or in playground,  crashes the LLDB RPC server; note that the function must also access the protocol's associated type.

Steps to Reproduce:
1. Create a generic function that uses a protocol with associated types as its generic constraint.
2. In order to also access the protocol's associatedtype, create a simple escaping completion handler that does so.
The function signature should look something like this

func load<R: Resource>(resource: R, completion: @escaping (R.Content?) -> ()) 

3. Call the function with a mismatched parameter. 
load(resource: 1) { res in
}

Expected Results:
I expected the Swift compiler to saying something in the lines of "Cannot convert type value 'Int' to expected argument type 'Resource'

Observed Results:
The Xcode project simply spits out a segmentation fault exit 11. In playground, Xcode simply says an internal error has occurred and that the LLDB  RPC server has crashed.

Version:
Xcode 8.3.3 (8E3004b)
macOS Sierra Version 10.12.5

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!