Code: Select all
function hash overload (inval as string) as integer
return 999
end function
namespace ns
function hash overload (inval as integer) as integer
return hash("hello") 'Type mismatch at parameter 1 of HASH
end function
print hash("string") 'Illegal inside a NAMESPACE block?
print hash(10) 'Illegal inside a NAMESPACE block?
end namespace
https://sourceforge.net/p/fbc/bugs/902/ Overloaded operators do not respect namespace
https://sourceforge.net/p/fbc/bugs/972/ A local Type cannot access members of an inherited Type external to its scope but normally accessible[Resolved] (Note this pertains to accessing a type member, not a globally defined symbol so not entirely related)
Two questions come up:
1) The namespace should be able to access the globally defined version of hash in this code, no? Is this distinct from bug 902?
2) What is illegal about calling those functions within the namespace?
I'm not seeing anything related to 2 in the documentation, and I think 1 is just a straight up bug. Can someone clarify what's going on here?