Skip to content

Commit 260178e

Browse files
committed
WI#2012 Use else if because StorageAreaKind are exclusive
1 parent 4e76053 commit 260178e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

TypeCobol/Compiler/Diagnostics/CrossChecker.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,13 @@ public override bool Visit(Move move)
229229
if (receiver == null) continue;
230230

231231
if (receiver.Kind == StorageAreaKind.FunctionCallResult)
232+
{
232233
DiagnosticUtils.AddError(move, "MOVE: illegal <function call> after TO");
233-
234-
if (senderIsAlphanumeric
235-
&& receiver.Kind == StorageAreaKind.DataOrCondition
236-
&& move.StorageAreaWritesDataDefinition != null
237-
&& move.StorageAreaWritesDataDefinition.TryGetValue(receiver, out var receiverDataDefinition))
234+
}
235+
else if (senderIsAlphanumeric
236+
&& receiver.Kind == StorageAreaKind.DataOrCondition
237+
&& move.StorageAreaWritesDataDefinition != null
238+
&& move.StorageAreaWritesDataDefinition.TryGetValue(receiver, out var receiverDataDefinition))
238239
{
239240
if (receiverDataDefinition.DataType == DataType.Numeric || receiverDataDefinition.DataType == DataType.NumericEdited)
240241
{

0 commit comments

Comments
 (0)