diff options
| author | Yong He <yonghe@outlook.com> | 2023-04-12 22:58:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-12 22:58:22 -0700 |
| commit | ca7bf79df3a3f5f4494912cb0572c36662755b9d (patch) | |
| tree | 64b14034326be8285c0265e74ad3ed11e29ff062 /source/slang/slang-ast-type.cpp | |
| parent | 12ec9b832fc74faba7162e54e04f7f48878ea88e (diff) | |
Combine lookupWitness lowering with specialization. (#2794)
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index 1fed2d52a..72f1764df 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -69,8 +69,8 @@ Type* Type::getCanonicalType() // TODO(tfoley): worry about thread safety here? auto canType = et->createCanonicalType(); et->canonicalType = canType; - - SLANG_ASSERT(et->canonicalType); + if (!et->canonicalType) + return getASTBuilder()->getErrorType(); } return et->canonicalType; } @@ -481,7 +481,9 @@ Type* NamedExpressionType::_createCanonicalTypeOverride() { if (!innerType) innerType = getType(m_astBuilder, declRef); - return innerType->getCanonicalType(); + if (innerType) + return innerType->getCanonicalType(); + return nullptr; } HashCode NamedExpressionType::_getHashCodeOverride() |
