Skip to content

[VFP] Incorrect scope of PUBLICS in the VFP dialect #2059

Description

@cpyrgas

In the VO dialect, the following code runs correctly. In the VFP dialect, when trying to access a PUBLIC defined in a called routine, throws a runtime error that the var does not exist:

#pragma options("memvar", enable)
#pragma options("undeclared", enable)
FUNCTION Start() AS VOID
	PUBLIC public_test
	public_test := "public_test"

	PUBLIC private_test
	private_test := "private_test"
	
	SomeProc()
	
	? public_nested // XSharp.Error: Variable does not exist: public_nested
RETURN

PROCEDURE SomeProc() AS VOID
	? public_test
	? private_test

	PUBLIC public_nested
	public_nested := "public_nested"
	? public_nested

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions