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.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 3882994da..2a6ee8abc 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -1471,6 +1471,11 @@ namespace Slang
}
else
{
+ if (varDecl->hasModifier<ExternModifier>())
+ {
+ getSink()->diagnose(initExpr, Diagnostics::externValueCannotHaveInitializer);
+ }
+
initExpr = CheckExpr(initExpr);
// TODO: We might need some additional steps here to ensure
@@ -1484,7 +1489,7 @@ namespace Slang
_validateCircularVarDefinition(varDecl);
}
-
+
// If we've gone down this path, then the variable
// declaration is actually pretty far along in checking
varDecl->setCheckState(DeclCheckState::DefinitionChecked);