Type inference refers to the automatic detection of the data type of an expression in a programming language.
It is a feature present in some strongly statically typed languages. It is often characteristic of functional programming languages in general. Some languages that include type inference include C++11, C# (starting with version 3.0), Chapel, Clean, Crystal, D, F#, FreeBASIC, Go, Haskell, Julia, Kotlin, ML, Nim, OCaml, Opa, RPython, Rust, Scala, Swift, Vala and Visual Basic (starting with version 9.0). The majority of them use a simple form of type inference, while especially those ones who use the Hindley-Milner type system provide a more complete type inference. The ability to infer types automatically makes many programming tasks easier, leaving the programmer free to omit type annotations while still permitting type checking.