File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1366,7 +1366,14 @@ AbstractionPattern::getFunctionThrownErrorType(
1366
1366
if (!substErrorType)
1367
1367
return std::nullopt ;
1368
1368
1369
- return std::make_pair (AbstractionPattern (*substErrorType),
1369
+ // FIXME: This is actually unsound. The most opaque form of
1370
+ // `(T) throws(U) -> V` should actually be
1371
+ // `(T) throws(any Error) -> V`.
1372
+ auto pattern = ((*substErrorType)->isErrorExistentialType ()
1373
+ ? AbstractionPattern (*substErrorType)
1374
+ : AbstractionPattern::getOpaque ());
1375
+
1376
+ return std::make_pair (pattern,
1370
1377
(*substErrorType)->getCanonicalType ());
1371
1378
}
1372
1379
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-emit-silgen %s
2
+ // RUN: %target-swift-emit-silgen %s -enable-library-evolution
3
+ // RUN: %target-swift-emit-silgen %s -enable-testing
4
+ // RUN: %target-swift-emit-silgen %s -enable-library-evolution -enable-testing
5
+
6
+ public struct Visitor < Node, Failure: Error > {
7
+ public var visit : ( Node ) throws ( Failure ) -> Void
8
+ }
You can’t perform that action at this time.
0 commit comments