rusty icon indicating copy to clipboard operation
rusty copied to clipboard

wrong downcast warning at SINT +1

Open tisis2 opened this issue 2 months ago • 0 comments

Describe the bug getting a wrong downcast warning when incrementing an SINT variable

To Reproduce Steps to reproduce the behavior:

VAR_GLOBAL
	cnt_SINT : SINT;
	cnt_INT  : INT;
	cnt_DINT : DINT;
	cnt_LINT : LINT;
	
	cnt_USINT : USINT;
	cnt_UINT  : UINT;
	cnt_UDINT : UDINT;
	cnt_ULINT : ULINT;
END_VAR

PROGRAM mainProg
VAR

END_VAR

cnt_SINT := cnt_SINT + 1;
cnt_INT := cnt_INT + 1;
cnt_DINT := cnt_DINT + 1;
cnt_LINT := cnt_LINT + 1;

cnt_USINT := cnt_USINT + 1;
cnt_UINT := cnt_UINT + 1;
cnt_UDINT := cnt_UDINT + 1;
cnt_ULINT := cnt_ULINT + 1;

END_PROGRAM

output shows: ...\src\mainProg.st:6:24:{6:24-6:25}: warning[E067]: Implicit downcast from 'BOOL' to 'SINT'.

Expected behavior should not result in any validation

tisis2 avatar May 08 '24 07:05 tisis2