diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 3342dd3c281..979607e96c0 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -621,7 +621,11 @@ private: case DeclContextKind::MacroDecl: return getOrCreateContext(DC->getParent()); case DeclContextKind::GenericTypeDecl: { + // The generic signature of this nominal type has no relation to the current + // function's generic signature. auto *NTD = cast(DC); + GenericContextScope scope(IGM, NTD->getGenericSignature().getCanonicalSignature()); + auto Ty = NTD->getDeclaredInterfaceType(); // Create a Forward-declared type. auto DbgTy = DebugTypeInfo::getForwardDecl(Ty); @@ -673,9 +677,6 @@ private: // The function return type is the first element in the list. createParameterType(Parameters, getResultTypeForDebugInfo(IGM, FnTy)); - // Actually, the input type is either a single type or a tuple - // type. We currently represent a function with one n-tuple argument - // as an n-ary function. for (auto Param : FnTy->getParameters()) createParameterType( Parameters, IGM.silConv.getSILType( diff --git a/test/DebugInfo/issue-63869.swift b/test/DebugInfo/issue-63869.swift new file mode 100644 index 00000000000..8da9bb9e6ac --- /dev/null +++ b/test/DebugInfo/issue-63869.swift @@ -0,0 +1,17 @@ +// RUN: %target-swift-frontend -emit-ir -g %s + +public protocol P { + associatedtype Element +} + +public struct G { + public struct Nested {} + + public init(_: (Nested) -> ()) {} +} + +public extension P { + var values: G { + G { x in } + } +}