summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/syntax.cpp')
-rw-r--r--source/slang/syntax.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp
index 5e855de29..74c817b92 100644
--- a/source/slang/syntax.cpp
+++ b/source/slang/syntax.cpp
@@ -303,6 +303,11 @@ void Type::accept(IValVisitor* visitor, void* extra)
return getPtrType(valueType, "InOutType").As<InOutType>();
}
+ RefPtr<RefType> Session::getRefType(RefPtr<Type> valueType)
+ {
+ return getPtrType(valueType, "RefType").As<RefType>();
+ }
+
RefPtr<PtrTypeBase> Session::getPtrType(RefPtr<Type> valueType, char const* ptrTypeName)
{
auto genericDecl = findMagicDecl(
@@ -2085,7 +2090,11 @@ void Type::accept(IValVisitor* visitor, void* extra)
{
auto paramDecl = paramDeclRef.getDecl();
auto paramType = GetType(paramDeclRef);
- if( paramDecl->FindModifier<OutModifier>() )
+ if( paramDecl->FindModifier<RefModifier>() )
+ {
+ paramType = session->getRefType(paramType);
+ }
+ else if( paramDecl->FindModifier<OutModifier>() )
{
if(paramDecl->FindModifier<InOutModifier>() || paramDecl->FindModifier<InModifier>())
{