diff --git a/DMCompiler/DM/Expressions/Dereference.cs b/DMCompiler/DM/Expressions/Dereference.cs index 4418d437913..fa0e5e0f9b8 100644 --- a/DMCompiler/DM/Expressions/Dereference.cs +++ b/DMCompiler/DM/Expressions/Dereference.cs @@ -338,6 +338,12 @@ internal sealed class ScopeReference(Location location, DMExpression expression, ]) ) { public override DreamPath? Path => Expression.Path; + public override DMComplexValueType ValType { + get { + TryAsConstant(out var constant); + return constant is not null ? constant.ValType : dmVar.ValType; + } + } public override string GetNameof(DMObject dmObject) => dmVar.Name;