Skip to content

[VFP] Problem with /fox3 and custom properties #2092

Description

@cpyrgas

When /fox3 is enabled, the following code throws a runtime error when trying to access a VFP property added at runtime via late bound code. If /fox3 is not enabled, then it runs as expected

#pragma options("fox3", enable)
#pragma options("allowdot", enable)
#pragma options("memvar", enable)
#pragma options("lb", enable)
#pragma options("undeclared", enable)

CLASS MyCustomClass INHERIT XSharp.VFP.Custom
	CONSTRUCTOR()
		SELF:AddProperty( "testprop", 123)
	
	METHOD Test() AS VOID
		? this.testprop // OK
		this.testprop := 456 // OK
		? this.testprop // OK
		? myself // OK
		? myself.testprop // Variable does not exist: MYSELF (only when /fox3 is enabled)
		myself.testprop := 123
		? myself.testprop
		
	PROPERTY myself AS USUAL GET SELF
END CLASS

FUNCTION Start() AS VOID
	LOCAL o AS MyCustomClass
	o := MyCustomClass{}
	o:Test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions