diff options
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 781a3a237..8030bcf97 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -7861,6 +7861,13 @@ namespace Slang if (semantics) semantics->ensureDecl(genericTypeConstraintDecl, DeclCheckState::ReadyForReference); auto constraintDeclRef = astBuilder->getDirectDeclRef<GenericTypeConstraintDecl>(genericTypeConstraintDecl); + auto supType = getSup(astBuilder, constraintDeclRef); + if (!supType) + { + args.add(astBuilder->getErrorType()); + shouldCache = false; + continue; + } auto witness = astBuilder->getDeclaredSubtypeWitness( getSub(astBuilder, constraintDeclRef), |
