Comment #7 on issue 268 by emil.len...@gmail.com: Can call non-static  
_unknown from a static context
http://code.google.com/p/gambas/issues/detail?id=268

Some more things:
* What should happen if _property is static but _unknown is dynamic or vice  
versa? ;) This code:

Static Public Function _property() As Boolean
End

Public Sub _unknown(...)
End

Public Sub TestFunction()
   Me.uuh = 3
End

-> Segmentation fault (The gambas stack gets corrupted)

And

Static Public Function _property() As Boolean
   Print "This is not written to stdout"
End

Public Sub _unknown(...)
   Print "This is written to stdout"
End

Public Sub TestFunction()
   Me.uuh()
End

-> i.e. _property is silently ignored, but _unknown is executed.

* _property must also be checked in about the same way when a property is  
written to:
Static Public Function _property() As Boolean
   Print "This message will not be written to stdout."
   Return True
End

Static Public Sub _unknown(...)
   Print "Not this message either"
End

Public Sub TestFunction()
   Me.uuh = 3
End

-> Shows nothing on the screen, i.e. none of _property or _unknown are  
executed, and no error message.

* In revision #4894 you cannot call a static function when having an  
object, like obj.unknown_function(), err msg "static function". But the  
convension is that static functions can actually be called even if you have  
an object. obj.known_static_function() works.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to