summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-type-layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
-rw-r--r--source/slang/slang-type-layout.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index b01b275f9..8b4c80554 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -3641,6 +3641,17 @@ static TypeLayoutResult _createTypeLayout(
return TypeLayoutResult(typeLayout, SimpleLayoutInfo());
}
+ else if( auto enumDeclRef = declRef.as<EnumDecl>() )
+ {
+ // We lay out an enumeration type as its tag type.
+ //
+ // TODO: This code doesn't handle the case where we might
+ // have a generic `enum` (or an `enum` inside another generic
+ // type), and where the tag type of the `enum` depends on
+ // one or more of the generic parameters.
+ //
+ return _createTypeLayout(context, enumDeclRef.getDecl()->tagType);
+ }
}
else if (auto errorType = as<ErrorType>(type))
{