From ff274cd32efcb687c9afdbd4952a656a8c97683f Mon Sep 17 00:00:00 2001 From: ItsDeltin Date: Fri, 15 Dec 2023 17:59:15 -0600 Subject: [PATCH] fix: Context is marked as used if a type is expected --- Deltinteger/Deltinteger/Parse/ParseInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deltinteger/Deltinteger/Parse/ParseInfo.cs b/Deltinteger/Deltinteger/Parse/ParseInfo.cs index 24ee36236..7356e338e 100644 --- a/Deltinteger/Deltinteger/Parse/ParseInfo.cs +++ b/Deltinteger/Deltinteger/Parse/ParseInfo.cs @@ -93,7 +93,7 @@ public ParseInfo AddVariableTracker(IVariableTracker variableTracker) CurrentUsageResolver = currentUsageResolver, SourceUsageResolver = sourceUsageResolver }; - public ParseInfo SetExpectType(CodeType type) => new ParseInfo(this) { ExpectingType = type }.SetExpectingLambda(type); + public ParseInfo SetExpectType(CodeType type) => new ParseInfo(this) { ExpectingType = type, IsUsedAsValue = true }.SetExpectingLambda(type); public ParseInfo SetReturnType(CodeType type) => new ParseInfo(this) { ReturnType = type }; public ParseInfo SetThisType(IDefinedTypeInitializer typeInitializer) => new ParseInfo(this) { TypeInitializer = typeInitializer }; public ParseInfo SetContextualModifierGroup(VariableModifierGroup modifierGroup) => new ParseInfo(this) { ContextualVariableModifiers = modifierGroup };