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(
13661366 if (!substErrorType)
13671367 return std::nullopt ;
13681368
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,
13701377 (*substErrorType)->getCanonicalType ());
13711378 }
13721379
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