From d2d09b40e57d293942bd4a6362966b4888bfc0a0 Mon Sep 17 00:00:00 2001 From: Penelope Haze Date: Thu, 31 Oct 2024 13:09:04 -0400 Subject: [PATCH] Add ValType override to ScopeReference --- DMCompiler/DM/Expressions/Dereference.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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;