TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

Wrong diagnostic on SET statement

Open fm-117 opened this issue 3 years ago • 0 comments

Describe the bug A wrong diagnostic is created on certain SET statements.

To Reproduce (Type)Cobol code that cause the bug : (if any)

       IDENTIFICATION DIVISION.
       PROGRAM-ID. Pgm.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 var-pointer POINTER.
       LINKAGE SECTION.
       01 var-date TYPE DATE.
       PROCEDURE DIVISION.
           SET ADDRESS OF var-date TO var-pointer
           GOBACK
           .
       END Program Pgm.

Parser issues message: Line 9[16,22] <30, Error, Semantics> - Semantic error: Cannot write Alphanumeric to strongly typed variable ADDRESS(var-date):DATE. There is no error if the var-date has a picture instead of a type.

Expected behavior No error should be created as the code is valid. This is related to type compatibility in general.

fm-117 avatar Jun 03 '21 08:06 fm-117