summaryrefslogtreecommitdiffstats
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.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 081ccbb0b..5aff41988 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -10428,16 +10428,7 @@ void SemanticsDeclHeaderVisitor::visitAbstractStorageDeclCommon(ContainerDecl* d
void SemanticsDeclHeaderVisitor::visitSubscriptDecl(SubscriptDecl* decl)
{
- // __subscript needs to have a return type specified. Check if return type
- // is missing (represented as IncompleteExpr) and return an error.
- if (decl->returnType.exp && as<IncompleteExpr>(decl->returnType.exp))
- {
- getSink()->diagnose(decl, Diagnostics::subscriptMustHaveReturnType);
- }
- else if (decl->returnType.exp)
- {
- decl->returnType = CheckUsableType(decl->returnType, decl);
- }
+ decl->returnType = CheckUsableType(decl->returnType, decl);
visitAbstractStorageDeclCommon(decl);