mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 17:40:35 +00:00
If a generic class inherits from a private parent (as allowed in C++), and attempts to access a member of that private parent, an error should be diagnosed via `DiagnoseInvalidQualifiedNameAccess`. A couple changes are needed to make that work, because the access constant in this case is not a `ClassType`. Instead, it's a `StructValue` of type `ParameterizedClassType`. So, use `TryGetTypeIdForTypeConstantId` instead of `GetTypeIdForTypeConstantId` (to get `None` instead of asserting on a non-type constant), and allow getting the class ID from both `ClassType` and `ParameterizedClassType`. --------- Co-authored-by: Christopher Di Bella <cjdb.ns@gmail.com>