File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1993,7 +1993,8 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
1993
1993
// without any contextual information, so even though `x` would get
1994
1994
// bound to result type of the chain, underlying type variable wouldn't
1995
1995
// be resolved, so we need to propagate holes up the conversion chain.
1996
- if (TypeVar->getImpl ().canBindToHole ()) {
1996
+ if (TypeVar->getImpl ().canBindToHole () &&
1997
+ srcLocator->directlyAt <OptionalEvaluationExpr>()) {
1997
1998
if (auto objectTy = type->getOptionalObjectType ()) {
1998
1999
if (auto *typeVar = objectTy->getAs <TypeVariableType>())
1999
2000
cs.recordPotentialHole (typeVar);
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift -swift-version 5
2
+
3
+ // https://github.com/apple/swift/issues/58661
4
+ class I58661 {
5
+ func throwing< T> ( ) throws -> T { // expected-note{{in call to function 'throwing()'}}
6
+ throw Swift . fatalError ( )
7
+ }
8
+
9
+ func reproduce( ) {
10
+ let check = try ? throwing ( ) // expected-error{{generic parameter 'T' could not be inferred}}
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments