Skip to content

Commit be98f6b

Browse files
authored
Merge pull request swiftlang#39310 from slavapestov/sil-verifier-method-self-type-fix
SIL: Use correct SILFunctionConventions when computing method self type in verifier
2 parents 3680f9c + 7e52fb5 commit be98f6b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,6 +3199,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
31993199
}
32003200

32013201
SILType getMethodSelfType(CanSILFunctionType ft) {
3202+
SILFunctionConventions fnConv(ft, F.getModule());
32023203
return fnConv.getSILType(ft->getParameters().back(),
32033204
F.getTypeExpansionContext());
32043205
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-emit-silgen %s -requirement-machine=verify
2+
3+
public class C<Key, Value> {
4+
public func method() -> Value { fatalError() }
5+
}
6+
7+
public func foo<T>(_: () -> T) {}
8+
9+
public func bar() {
10+
foo { C<Int, Int>().method() }
11+
}

0 commit comments

Comments
 (0)