File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -3426,7 +3426,9 @@ CanSILFunctionType swift::buildSILFunctionThunkType(
34263426
34273427 if (!capturedEnvs.empty () ||
34283428 expectedType->hasPrimaryArchetype () ||
3429- sourceType->hasPrimaryArchetype ()) {
3429+ sourceType->hasPrimaryArchetype () ||
3430+ (inputSubstType && inputSubstType->hasPrimaryArchetype ()) ||
3431+ (outputSubstType && outputSubstType->hasPrimaryArchetype ())) {
34303432 // Get the existing generic signature.
34313433 baseGenericSig = fn->getLoweredFunctionType ()
34323434 ->getInvocationGenericSignature ();
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-emit-silgen %s
2+
3+ // https://github.com/swiftlang/swift/issues/86118
4+
5+ // The AST type of the thunk depends on the generic signature, but the
6+ // lowered type does not, because we can see the opaque return type's
7+ // underlying type from the expansion point, and it does not involve
8+ // type parameters. Make sure this does not cause us to assert.
9+
10+ public struct G < T> {
11+ public static func f( _: Any , _: Any ) -> some Any {
12+ return 123
13+ }
14+ }
15+
16+ public func g< T> ( _: T ) {
17+ let fn : ( Any , Any ) -> _ = G< T> . f
18+ let fn2 : ( Int , Int ) -> _ = fn
19+ }
You can’t perform that action at this time.
0 commit comments