Use the CAST function's first parameter to determine the type of the object and offer code completion accordingly.
In the following example, the CAST function is used to cast the first object from the vector into a HashMap, therefore the code assist should offer methods as for a HashMap. Instead, a linking-error is shown:
use java.util.HashMap
declare BBjVector vector!
vector! = new BBjVector()
vector!.add(new HashMap())
rem Could not resolve reference to ClassMember named 'put'.bbj(linking-error)
cast(HashMap, vector!.get(0)).put("Demo")
We could introduce a generic type for scalar library function.
CAST(param: T, param: object, ERR?:lineref): T
... or just hardcode CAST in type computation.
Use the CAST function's first parameter to determine the type of the object and offer code completion accordingly.
In the following example, the CAST function is used to cast the first object from the vector into a HashMap, therefore the code assist should offer methods as for a HashMap. Instead, a linking-error is shown: