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; } }