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
--- ERROR ---
In `source/test.rs`:
Type mismatch: Expected `bool`, found `opt[bool]`
6,8: if foo() {
6,8: ^
Any
An any type works with any other type except void.
Non-guarantee of argument type inside function body
Consider a simple example like this:
fnfoo(a:bool){ ...}
It is not guaranteed that a has the type bool inside the function body. This is because the function can be called with an argument that is inferred to any at type checking.
Motivation
These rules are designed for:
Fast coding without having to fill out all the types
Catch errors earlier when changing Rust/Dyon interface
Backward compatible with old code when developing more advanced type checking later
The text was updated successfully, but these errors were encountered:
Dyon uses an optional type system, one that complains if the types are proven to be wrong.
bool
(boolean)f64
(number)vec4
(4D vector)[]
/[T]
(array){}
(object)opt[T]
(option)res[T]
(result)thr[T]
(thread)any
- no syntax keyword - (any type, exceptvoid
)void
- no syntax keyword - (no value type)Example
Any
An
any
type works with any other type exceptvoid
.Non-guarantee of argument type inside function body
Consider a simple example like this:
It is not guaranteed that
a
has the typebool
inside the function body. This is because the function can be called with an argument that is inferred toany
at type checking.Motivation
These rules are designed for:
The text was updated successfully, but these errors were encountered: