Files
swift-mirror/test/SILGen/skip_local_function_bodies.swift
Slava Pestov 83bb9d0fe2 Sema: Fix regression with -experimental-skip-non-inlinable-function-bodies-without-types
My recent capture analysis refactoring broke a subtle corner case that wasn't
exercised by the test suite.

If a local inside g() was skipped, but the outer function was not skipped, we would
return the empty list of captures for g(). But if the interface type of g() actually
involves an outer generic parameter type, then the empty capture list did not record
the fact that a generic signature was needed, so we attempted to form a call to the
local function without a generic signature.
2024-04-23 22:28:03 -04:00

17 lines
342 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types %s -emit-module-path %t/skip_local_function_bodies.swiftmodule
public protocol P {
init()
}
extension P {
public func f() {
typealias T = Self
func g(_ x: T) {}
g(self)
}
}