you are viewing a single comment's thread
view the rest of the comments
[–] 7 points 1 day ago (1 child)

I think that's so type inference can work by just omitting the type, instead of having to use "var" or "auto" in front of the variable name

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 1 day ago

    not precisely. Rust has let mut and Kotlin has val; ie the member layout and the mutability are treated differently, since those languages have mutability rules.

    this is a circular argument anyway. the language designers could have figured out a way to do type inference like, eg, Java, but, again, explicitly chose not to.

  • source
  • parent