Commits

Joe Groff committed 6ea8add764f
SILGen: Forward archetypes into local function contexts (take 2). If a closure appears in a generic function, the standalone function type for the SIL function needs to include not only the captured values from the outer context, but the generic parameters from the outer context as well. In order to maintain SIL invariants we then need to hand generic parameters from the outer function to the inner closure using a SpecializeInst before partially applying the inner function to create the closure object. It turns out that ImplicitClosureExprs seem to always be given null parent DeclContexts, so getFunctionTypeWithCaptures was missing adding the generic parameters into implicit closures, causing a crash building the stdlib. This version of the patch has a workaround for the case where a function is generic but a closure in the function is not generic with context (which shouldn't happen if the decl contexts are set correctly). Swift SVN r5429