Skip to content

[VFP] Incorrect behavior of DIMENSION with LOCAL #2063

Description

@cpyrgas

Low priority, as I don't think this is used often, just found it while investigating the automated test suite problems.

In VFP, it's possible to declare a LOCAL, then use DIMENSION to change its type to an array. In X#, currently if I understand correctly, DIMENSION creates a new memvar with the same name (?). See below and test R788:

FUNCTION Start( ) AS VOID
    LOCAL aLocal
    // warning XS0168: The variable 'aLocal' is declared but never used

    // That's not correct, the dimension below should use the aLocal and turn in into an array (confirmed with VFP test)
    Dimension aLocal(10) 
    

    Dimension aPublic(10) 
    
    ? ALen(aLocal)

    ? ALen(aPublic)
    
    testnested()
RETURN

procedure testnested() AS VOID
	? ALen(aPublic) 

	? ALen(aLocal) // there should be an exception here, var is a local of the calling function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions