From df4ef552ad038ff74707df23041ecb3df28e901c Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Mon, 12 Oct 2026 19:02:57 +0000 Subject: [PATCH] Add missing case for non-parameterized generic classes. (#7952) Fixes #7950 --- toolchain/check/import_ref.cpp | 3 +++ toolchain/check/testdata/class/nested_in_generic.carbon | 3 +++ 2 files changed, 6 insertions(+) diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index b378fdb14d3d..27ee2c7a623a 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1051,6 +1051,9 @@ static auto GetLocalGenericId(ImportContext& context, case CARBON_KIND(SemIR::FunctionType fn_type): { return context.local_functions().Get(fn_type.function_id).generic_id; } + case CARBON_KIND(SemIR::ClassType class_type): { + return context.local_classes().Get(class_type.class_id).generic_id; + } case CARBON_KIND(SemIR::ParameterizedClassType class_type): { return context.local_classes().Get(class_type.class_id).generic_id; } diff --git a/toolchain/check/testdata/class/nested_in_generic.carbon b/toolchain/check/testdata/class/nested_in_generic.carbon index 067edebac4f3..0bef0802a464 100644 --- a/toolchain/check/testdata/class/nested_in_generic.carbon +++ b/toolchain/check/testdata/class/nested_in_generic.carbon @@ -12,8 +12,11 @@ // --- generic_with_nested.carbon package P library "generic_with_nested"; +class X {}; + class C(T: type) { class Nested { + var x: X; } }