Questions Concepts
GitHub icon

Type Inference

Type Inference - language feature

< >
Example from Speedie:
|| x = "Hello" || y = FunctionThatReturnsAString() // is now a string x = 1 // fails to compile y = 2 // fails to compile

Languages with Type Inference include Go, Swift, Scala, Rust, Kotlin, Haskell, TypeScript, Prolog, Crystal, F#, Elm, OCaml, D, Haxe, ML, RDF, Standard ML, Frege, Nemerle, Opa, Ceylon, Boo, Speedie, Xtend, Stan, Obliq, CLPR, GAEA, Static Typescript, Progol

This question asks: Can the parser infer the type of a variable at compile time without an annotation?

Read more about Type Inference on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Traffic Traffic Today Day 305 Logout