summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-type.cpp')
-rw-r--r--source/slang/slang-check-type.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-check-type.cpp b/source/slang/slang-check-type.cpp
index 5967da8b0..b5ee2c4fc 100644
--- a/source/slang/slang-check-type.cpp
+++ b/source/slang/slang-check-type.cpp
@@ -317,6 +317,8 @@ namespace Slang
if (!genericTypeParamDecl)
return false;
auto defaultType = CheckProperType(genericTypeParamDecl->initType);
+ if (!defaultType)
+ return false;
auto witness = tryGetSubtypeWitness(defaultType, CheckProperType(constraintParam->sup));
if (!witness)
{
@@ -326,8 +328,6 @@ namespace Slang
Diagnostics::typeArgumentDoesNotConformToInterface,
defaultType,
constraintParam->sup);
-
- SLANG_UNEXPECTED("default type argument does not conform to interface");
return false;
}
witnessArgs.add(witness);