Skip to content

Type inference

Viktor Söderqvist edited this page Dec 22, 2018 · 1 revision

By default, Gradualizer is not using type inference.

The only types that are used are the types that are specified in a spec, in a typed record definitions and in type specifiers in bit string expressions. The reason for this is that no type errors should be reported for untyped code. See Gradual typing for a more thorough explanation.

There is an option {infer, boolean()} (or --infer in the CLI) which enables more types to be propagated. With this option, the types of literals, tuples and other language constructs are also propagated. This lets the Gradualizer report type errors also for code where types are not explicitly specified.

Clone this wiki locally