diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-23 20:45:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-24 11:45:59 +0800 |
| commit | ee709cffe520df3cf082dc7923609c42dd14cabc (patch) | |
| tree | 99aacd40cb9e1d80e5c654620e6fe43182768376 /source/slang | |
| parent | 61aa670237e2d51f7144322bf56b8ce3633c2db9 (diff) | |
Fix language server crash. (#5395)
Diffstat (limited to 'source/slang')
| -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), |
