Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,7 @@ static void emitEntryPointArgumentsNativeCC(IRGenSILFunction &IGF,
bool isIndirectError = fnConv.hasIndirectSILErrorResults();

if (isTypedError && !isIndirectError) {
auto &errorTI = cast<FixedTypeInfo>(IGF.getTypeInfo(errorType));
auto &errorTI = cast<FixedTypeInfo>(IGF.getTypeInfo(inContextErrorType));
IGF.setCallerTypedErrorResultSlot(Address(
emission->getCallerTypedErrorResultArgument(),
errorTI.getStorageType(),
Expand Down
5 changes: 5 additions & 0 deletions test/IRGen/typed_throws.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@ func testit() throws (S) {
public struct TypeH {
public var method: (Int) throws(MyBigError) -> String
}

// Used to crash with null GenericSignature -- https://github.com/swiftlang/swift/issues/77297
struct LoadableGeneric<E>: Error {}

func throwsLoadableGeneric<E>(_: E) throws(LoadableGeneric<E>) {}