TypeCobol
TypeCobol copied to clipboard
Wrong diagnostic on SET statement
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.