summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index b7f65a11a..5ca1baeec 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -8430,6 +8430,11 @@ namespace Slang
{
auto typeExpr = paramDecl->type;
+ if (!as<ArrayExpressionType>(paramDecl->type) && doesTypeHaveTag(paramDecl->type, TypeTag::Unsized))
+ {
+ getSink()->diagnose(paramDecl, Diagnostics::paramCannotBeUnsized, paramDecl);
+ }
+
// The "initializer" expression for a parameter represents
// a default argument value to use if an explicit one is
// not supplied.