Why is this possible?
Why it is possible to access private types functionality by a public field? Shouldn't this produce compiler errors?
If it is legit, then you can use a private type instanced in a field of a public type to store and get all private fields, methods, globals and funcs in a class!!
Something like:
Is this 'legal' ?
Type MyTypeA Field MyField:MyTypeB = New TypeB End Type Private Type MyTypeB Method Draw:int() End Method End Type Public Local MyInstance:TypeA = New TypeA MyInstance.MyField.Draw()
Why it is possible to access private types functionality by a public field? Shouldn't this produce compiler errors?
If it is legit, then you can use a private type instanced in a field of a public type to store and get all private fields, methods, globals and funcs in a class!!
Something like:
Type MyClass Field _Private:MyClassPrivate = New MyClassPrivate Method MyMethod1:int() 'Use a private field: Return _Private.PrivateField1 End Method Method MyMethod2(K:int, J:Int) 'Call internally a private method: Local X:int = _private.MyMethod1(self, k) 'Store the result in a private field: _private.PrivateField1 = x End Method End Type Private Type MyClassPrivate Field PrivateField1:int, PrivateField2 Method PrivateMethod1:int(BaseClass:MyClass, OtherParams) End Method end Type
Is this 'legal' ?