mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:11:04 +01:00
Parameterized impl declarations (#1189)
* parameterized impls, first step * bug fixes, comments, etc. * added another test case, fix a bug in impl lookup * simplify tests, removing tuple stuff * don't create impl bindings for -bound implicit parameters * remove a redundant 'private' * CamelCase * add missing backtick * add a comment
This commit is contained in:
@@ -19,14 +19,13 @@ class Value;
|
||||
class Expression;
|
||||
class ImplBinding;
|
||||
|
||||
// The run-time counterpart of a `GenericBinding`.
|
||||
//
|
||||
// Once a generic binding has been declared, it can be used
|
||||
// in two different ways: as a compile-time constant with a
|
||||
// symbolic value (such as a `VariableType`), or as a run-time
|
||||
// variable with a concrete value that is stored on the stack.
|
||||
// An `ImplBinding` is used in contexts where the second
|
||||
// interpretation is intended.
|
||||
// `ImplBinding` plays the role of the parameter for passing witness
|
||||
// tables to a generic. However, unlike regular parameters
|
||||
// (`BindingPattern`) there is no explicit syntax that corresponds to
|
||||
// an `ImplBinding`, so they are not created during parsing. Instances
|
||||
// of `ImplBinding` are created during type checking, when processing
|
||||
// a type parameter (a `GenericBinding`), or an `is` requirement in
|
||||
// a `where` clause.
|
||||
class ImplBinding : public AstNode {
|
||||
public:
|
||||
using ImplementsCarbonValueNode = void;
|
||||
|
||||
Reference in New Issue
Block a user