summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-impl.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-06-13 22:13:00 -0700
committerGitHub <noreply@github.com>2025-06-13 22:13:00 -0700
commit6a23949f07f4eba38086b656e7073ce3bf8cd2fe (patch)
tree132bbe330b6027d323c74175686d006605e4da6d /source/slang/slang-check-impl.h
parente72b3325663ab6d4bb791742574b031f0df6328a (diff)
Allow interface methods to have default implementations. (#7439)
Diffstat (limited to 'source/slang/slang-check-impl.h')
-rw-r--r--source/slang/slang-check-impl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-check-impl.h b/source/slang/slang-check-impl.h
index 1cdebb115..be6b1c2fc 100644
--- a/source/slang/slang-check-impl.h
+++ b/source/slang/slang-check-impl.h
@@ -1837,6 +1837,8 @@ public:
/// The type for which conformances are being checked
Type* conformingType;
+ Witness* conformingWitness;
+
/// The outer declaration for the conformances being checked (either a type or `extension`
/// declaration)
ContainerDecl* parentDecl;
@@ -2027,6 +2029,13 @@ public:
// Check and register a type if it is differentiable.
void maybeRegisterDifferentiableType(ASTBuilder* builder, Type* type);
+ // Find the default implementation of an interface requirement,
+ // and insert it to the witness table, if it exists.
+ bool findDefaultInterfaceImpl(
+ ConformanceCheckingContext* context,
+ DeclRef<Decl> requiredMemberDeclRef,
+ RefPtr<WitnessTable> witnessTable);
+
// Find the appropriate member of a declared type to
// satisfy a requirement of an interface the type
// claims to conform to.
@@ -2989,6 +2998,7 @@ public:
Expr* visitThisExpr(ThisExpr* expr);
Expr* visitThisTypeExpr(ThisTypeExpr* expr);
+ Expr* visitThisInterfaceExpr(ThisInterfaceExpr* expr);
Expr* visitCastToSuperTypeExpr(CastToSuperTypeExpr* expr);
Expr* visitReturnValExpr(ReturnValExpr* expr);
Expr* visitAndTypeExpr(AndTypeExpr* expr);