Swift: Compiler crash with type-parameterized function containing curried function

Originator:rix.rob
Number:rdar://19758803 Date Originated:07-Feb-2015 10:19 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.1.1 (6A2008a)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Any type-parameterized function containing a curried local function crashes the compiler.


Steps to Reproduce:
1. Compile this code:

func f<T>() { func g()() {} }


Expected Results:
I expected it to compile.


Actual Results:
Swift crashed:
1.	While emitting SIL for 'f' at ./boom.swift:3:1
2.	While emitting reabstraction thunk in SIL function @_TTRG0_R_XFo__dT__XFo__oXFo__dT___ for 'g' at ./boom.swift:3:15
3.	While emitting reabstraction thunk in SIL function @_TTRG0_R_T_XFo__dT__ for 'g' at ./boom.swift:3:15


Regression:
1. It doesn’t crash if f has no type parameters, i.e. func f() { … }

2. It doesn’t crash if g is uncurried:

	func f<T>() { func g() -> () -> () { return {} } }

3. It doesn’t crash if g has only one parameter tuple, i.e. func g().


Notes:
N/A

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!