From b2fb0f7134de4e0b1a0db685eb1ae3c0678a33c5 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 10 Jul 2017 10:44:02 -0700 Subject: Try to be more robust against un-checked types during lowering, etc. - Try to handle `ErrorType` gracefully when computing type layouts - When outputting a `TypeExp`, if the type part is errorneous (or missing), try to use the expression part - Make sure to lower the expressions side of a `TypeExp` during lowering --- source/slang/reflection.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/reflection.cpp') diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index eb27df398..08621d9a3 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -148,6 +148,11 @@ SLANG_API SlangTypeKind spReflectionType_GetKind(SlangReflectionType* inType) return SLANG_TYPE_KIND_STRUCT; } } + else if (auto errorType = type->As()) + { + // This means we saw a type we didn't understand in the user's code + return SLANG_TYPE_KIND_NONE; + } assert(!"unexpected"); return SLANG_TYPE_KIND_NONE; -- cgit v1.2.3