summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-lower-to-ir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index fefec805c..b2a7529c5 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -2231,6 +2231,14 @@ ParameterDirection getThisParamDirection(Decl* parentDecl, ParameterDirection de
return defaultDirection;
}
+ // A parent generic declaration should not change the
+ // mutating-ness of the inner declaration.
+ //
+ if( as<GenericDecl>(parentDecl) )
+ {
+ return defaultDirection;
+ }
+
// For now we make any `this` parameter default to `in`.
//
return kParameterDirection_In;