Hacker News new | past | comments | ask | show | jobs | submit login

You may have a broader scenario in mind, but my experience is limited to languages like Rust and C where the type is linked to an object the moment that object is declared for the first time, and can't be changed later. These languages do use the same syntax for definition and type annotation.

I will remember this conversation when I encounter a language that allows this (declaration in the first line, type annotations follow):

  var x
  x : Integer
  x = 5
  ...
  x : String
  x = "hello"



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: