Merge pull request #14411 from aschwaighofer/sema_require_layout_generic_params

Sema: Request the layout for generic parameters if there is a body
This commit is contained in:
Arnold Schwaighofer
2018-02-06 06:18:21 -08:00
committed by GitHub
11 changed files with 169 additions and 1 deletions

View File

@@ -7494,6 +7494,10 @@ namespace {
if (tc.coerceParameterListToType(params, closure, fnType))
return { false, nullptr };
// Require layout of dependent types that could be used to materialize
// metadata types/conformances during IRGen.
tc.requestRequiredNominalTypeLayoutForParameters(params);
// If this is a single-expression closure, convert the expression
// in the body to the result type of the closure.
if (closure->hasSingleExpressionBody()) {