From ca7bf79df3a3f5f4494912cb0572c36662755b9d Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 12 Apr 2023 22:58:22 -0700 Subject: Combine lookupWitness lowering with specialization. (#2794) --- source/slang/slang-ast-type.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ast-type.cpp') 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() -- cgit v1.2.3