mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Use the correct type for Self in generic classes and generic interfaces (#4087)
In a `class C(T:! type)`, the type `Self` should be `C(T)`, not merely `C`. Similarly, in an `interface I(T:! type)`, the type of self should be `I(T)`, not merely `I`.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "toolchain/base/kind_switch.h"
|
||||
#include "toolchain/check/diagnostic_helpers.h"
|
||||
#include "toolchain/check/generic.h"
|
||||
#include "toolchain/diagnostics/diagnostic_emitter.h"
|
||||
#include "toolchain/sem_ir/builtin_function_kind.h"
|
||||
#include "toolchain/sem_ir/function.h"
|
||||
@@ -15,14 +16,6 @@
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
static auto MakeGenericInstance(Context& context, SemIR::GenericId generic_id,
|
||||
SemIR::InstBlockId args_id)
|
||||
-> SemIR::GenericInstanceId {
|
||||
auto instance_id = context.generic_instances().GetOrAdd(generic_id, args_id);
|
||||
// TODO: Perform substitution into the generic declaration if needed.
|
||||
return instance_id;
|
||||
}
|
||||
|
||||
namespace {
|
||||
// The evaluation phase for an expression, computed by evaluation. These are
|
||||
// ordered so that the phase of an expression is the numerically highest phase
|
||||
|
||||
Reference in New Issue
Block a user