summaryrefslogtreecommitdiffstats
path: root/source/slang/reflection.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-10 10:44:02 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-10 10:44:02 -0700
commitb2fb0f7134de4e0b1a0db685eb1ae3c0678a33c5 (patch)
tree5597bca9d791391e069c8997a84ac9a8b1061024 /source/slang/reflection.cpp
parent8abdf2dddd10feb9794c86cdf6b2159a2b6383e4 (diff)
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
Diffstat (limited to 'source/slang/reflection.cpp')
-rw-r--r--source/slang/reflection.cpp5
1 files changed, 5 insertions, 0 deletions
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<ErrorType>())
+ {
+ // 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;