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
For function parameters, we also support any to declare that a certain function accepts any type of argument. As a "counterpart" for this, an unkown type would be great. unkown should indicate that we do not know what a function returns. This is usefull for syscall abstractions, since they can return a whole lot of different values/types:
declare syscall : (any) -> unkown
One could use any as the return type, but in my opinion, unkown and any are semantically different (as mentioned above) and should be treated like that.
To correctly work with unknown return values, we should allow for type conversion from unkown to every other type (through type annotation : TYPE at a variable definition or as a function return type). Conversions from any other type to unkown should be currently prohobited and throw a type error.
Condition of Satisfaction
new type unkown exists
unkown can be used as function return type
conversion fromunkown to any other type work
conversion tounknown from any other type throw a TypeError
The text was updated successfully, but these errors were encountered:
Currently, Y support several builtin types:
int
str
bool
void
For function parameters, we also support
any
to declare that a certain function accepts any type of argument. As a "counterpart" for this, anunkown
type would be great.unkown
should indicate that we do not know what a function returns. This is usefull for syscall abstractions, since they can return a whole lot of different values/types:One could use
any
as the return type, but in my opinion,unkown
andany
are semantically different (as mentioned above) and should be treated like that.To correctly work with
unknown
return values, we should allow for type conversion fromunkown
to every other type (through type annotation: TYPE
at a variable definition or as a function return type). Conversions from any other type tounkown
should be currently prohobited and throw a type error.Condition of Satisfaction
unkown
existsunkown
can be used as function return typeunkown
to any other type workunknown
from any other type throw aTypeError
The text was updated successfully, but these errors were encountered: