You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type myType = <str>;
fun handleAnything(any value) -> typeOf(value) == myType;
Types as value
typeof operator
Edge cases:
We would expect a reference to MyObject to be a type, but it's not. It's a reference to the value ObjObject. So user whishing to get the MyObject type would have to do: typeof MyObject.
On the other hand, a foreign struct is an ObjTypeDef at runtime so we don't need the typeof operator to get its type.
Same for Protocol whose runtime representation is also an ObjTypeDef
The text was updated successfully, but these errors were encountered:
First class types
typeof
operatorEdge cases:
MyObject
to be a type, but it's not. It's a reference to the valueObjObject
. So user whishing to get theMyObject
type would have to do:typeof MyObject
.ObjTypeDef
at runtime so we don't need thetypeof
operator to get its type.Protocol
whose runtime representation is also anObjTypeDef
The text was updated successfully, but these errors were encountered: