Type Test Limitations in Leaf Procedures?

General discussions about working with the Astrobe IDE and programming ARM Cortex-M3, M4 and M7 microcontrollers.

Type Test Limitations in Leaf Procedures?

Postby gray » Sun Apr 14, 2019 1:36 am

Code: Select all
MODULE M5;

  TYPE
    T1 = RECORD
    END;
   
    T2 = RECORD(T1)
    END;
 
  PROCEDURE* P1(t: T1);
  BEGIN
    CASE t OF (* invalid type *)
      T2:     (* case label must be ... *)
    END
  END P1;
 
  PROCEDURE* P2(t: T1);
  BEGIN
    IF t IS T2 THEN END (* type mismatch *)
  END P2;
 
END M5.

Note the leaf procedures. The compiler flags the type tests with the error messages as indicated in the comments. I couldn't find any mention of a limit on type tests in leaf procedures in the docs. Is this an intended limitation?
gray
 
Posts: 29
Joined: Tue Feb 12, 2019 2:59 am

Re: Type Test Limitations in Leaf Procedures?

Postby cfbsoftware » Mon Apr 15, 2019 12:11 pm

Thank you for your report. On first sight it appears to be a limitation which I was not aware of. Note that the record parameters in these examples should be VAR parameters, but the problem still remains.

Leaf procedures with POINTER parameters appear to be OK.
cfbsoftware
Site Admin
 
Posts: 383
Joined: Fri Dec 31, 2010 12:30 pm


Return to Astrobe for ARM Cortex-M3, M4 and M7