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 @@ -3605,7 +3605,9 @@ CanSILFunctionType swift::buildSILFunctionThunkType(
36053605
36063606 if (!capturedEnvs.empty () ||
36073607 expectedType->hasPrimaryArchetype () ||
3608- sourceType->hasPrimaryArchetype ()) {
3608+ sourceType->hasPrimaryArchetype () ||
3609+ (inputSubstType && inputSubstType->hasPrimaryArchetype ()) ||
3610+ (outputSubstType && outputSubstType->hasPrimaryArchetype ())) {
36093611 // Get the existing generic signature.
36103612 baseGenericSig = fn->getLoweredFunctionType ()
36113613 ->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