diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index 0a101dd2f0c76..8028e6e391d89 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -3818,7 +3818,7 @@ RValue CallEmission::applyEnumElementConstructor(SGFContext C) { resultFnType.getParams(), /*canonicalVararg*/ true); auto arg = RValue(SGF, argVals, payloadTy->getCanonicalType()); - payload = ArgumentSource(element, std::move(arg)); + payload = ArgumentSource(uncurriedLoc, std::move(arg)); formalResultType = cast(formalResultType).getResult(); origFormalType = origFormalType.getFunctionResultType(); } else { diff --git a/test/SILGen/Inputs/enum_debuginfo_other.swift b/test/SILGen/Inputs/enum_debuginfo_other.swift new file mode 100644 index 0000000000000..d644de37f4885 --- /dev/null +++ b/test/SILGen/Inputs/enum_debuginfo_other.swift @@ -0,0 +1,3 @@ +public enum MyEnum { + case hasPayload(argument: Any) +} diff --git a/test/SILGen/enum_debuginfo.swift b/test/SILGen/enum_debuginfo.swift new file mode 100644 index 0000000000000..6f48888feab58 --- /dev/null +++ b/test/SILGen/enum_debuginfo.swift @@ -0,0 +1,7 @@ +// RUN: %target-swift-frontend -emit-silgen %S/Inputs/enum_debuginfo_other.swift -primary-file %s -module-name enum_debuginfo -g -Xllvm -sil-print-debuginfo | %FileCheck %s + +public func makeEnum() -> MyEnum { + return .hasPayload(argument: 123) +} + +// CHECK-NOT: enum_debuginfo_other.swift