summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/syntax.cpp')
-rw-r--r--source/slang/syntax.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp
index 9ca2dc827..ca66e2110 100644
--- a/source/slang/syntax.cpp
+++ b/source/slang/syntax.cpp
@@ -189,6 +189,8 @@ void Type::accept(IValVisitor* visitor, void* extra)
{
// TODO(tfoley): worry about thread safety here?
et->canonicalType = et->CreateCanonicalType();
+ if (dynamic_cast<Type*>(et->canonicalType) != this)
+ et->canonicalTypeRefPtr = et->canonicalType;
SLANG_ASSERT(et->canonicalType);
}
return et->canonicalType;
@@ -861,7 +863,9 @@ void Type::accept(IValVisitor* visitor, void* extra)
Type* NamedExpressionType::CreateCanonicalType()
{
- return GetType(declRef)->GetCanonicalType();
+ if (!innerType)
+ innerType = GetType(declRef);
+ return innerType->GetCanonicalType();
}
int NamedExpressionType::GetHashCode()