diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-15 18:54:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 18:54:16 -0700 |
| commit | c97166aed29e0a224d49cec0b12503d1a10b52e0 (patch) | |
| tree | 1894ff8a3b608d66f55f5f2bd47640e679e59e78 /source | |
| parent | 99a242eca78149a61c0521d319e96ededec7168d (diff) | |
Fix type checking on generic extensions. (#5316)
Add fcpw library to test suite.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-check-inheritance.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/slang/slang-check-inheritance.cpp b/source/slang/slang-check-inheritance.cpp index 0d3929901..360fc0d14 100644 --- a/source/slang/slang-check-inheritance.cpp +++ b/source/slang/slang-check-inheritance.cpp @@ -437,8 +437,6 @@ namespace Slang // representation would need to take into account canonicalization of // constraints. - ensureDecl(&visitor, genericDeclRef.getDecl(), DeclCheckState::CanSpecializeGeneric); - if (auto extensionDecl = as<ExtensionDecl>(genericDeclRef.getDecl()->inner)) { if (isDeclRefTypeOf<GenericTypeParamDecl>(extensionDecl->targetType.type) == declRef) @@ -459,6 +457,11 @@ namespace Slang for (auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(astBuilder, genericDeclRef)) { + if (constraintDeclRef.getDecl()->checkState.isBeingChecked()) + continue; + + ensureDecl(&visitor, constraintDeclRef.getDecl(), DeclCheckState::CanSpecializeGeneric); + auto subType = getSub(astBuilder, constraintDeclRef); auto superType = getSup(astBuilder, constraintDeclRef); |
