Open Centril opened 2 years ago
Either for development purposes, or in general, we could add global type inference to Sway. For example, you could define a function:
fn foo(a, b) { a * b }
and a type signature could be inferred for foo.
foo
Then we can decide either to emit the inferred type as an error, as a design decision. Or, we could allow the function foo as legal code.
Another related concept is introducing typed holes, like so:
fn foo(a: ?, b: ?) { a * b }
cc @emilyaherbert
Either for development purposes, or in general, we could add global type inference to Sway. For example, you could define a function:
and a type signature could be inferred for
foo
.Then we can decide either to emit the inferred type as an error, as a design decision. Or, we could allow the function
foo
as legal code.Another related concept is introducing typed holes, like so: